home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 1 / Amiga Tools.iso / egs-tools / egs_dev-disk / egsincludes / egs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-06  |  97.7 KB  |  2,623 lines

  1. #ifndef EGS_EGS_H
  2. #define EGS_EGS_H
  3.  
  4. /***************************************************************************\
  5. *  $
  6. *  $ FILE     : egs.h
  7. *  $ VERSION  : 2
  8. *  $ REVISION : 2
  9. *  $ DATE     : 08-Dec-93 12:22
  10. *  $
  11. *  $ Author   : mvk
  12. *  $
  13. *
  14. *  Device Libs
  15. *
  16. *
  17. *****************************************************************************
  18. *                                                                           *
  19. * (c) Copyright 1990/94 VIONA Development                                   *
  20. *     All Rights Reserved                                                   *
  21. *                                                                           *
  22. \***************************************************************************/
  23.  
  24. #ifndef         EXEC_TYPES_H
  25. #include        <exec/types.h>
  26. #endif
  27. #ifndef         EXEC_PORTS_H
  28. #include        <exec/ports.h>
  29. #endif
  30. #ifndef         EXEC_SEMAPHORES_H
  31. #include        <exec/semaphores.h>
  32. #endif
  33. #ifndef         UTILITY_TAGITEM_H
  34. #include        <utility/Tagitem.h>
  35. #endif
  36.  
  37. /*
  38.  * This library is the basic interface to high resolution graphics boards.
  39.  * The hardware is almost completely encapsulated by this module. It is
  40.  * not allowed to access hardware registers directly.
  41.  *
  42.  * The library is designed for full multitasking support. Thus several
  43.  * programs can use the graphic boards simultaneously. Screens can be
  44.  * switched like Intuition screens by pressing the left Amiga key and "M".
  45.  * See EGS-Input Preferences.
  46.  *
  47.  * Moreover, a separate mouse pointer is supported.  The Amiga mouse and
  48.  * EGS mouse can be exchanged by pressing the left Amiga key and "A".
  49.  * If the mouse pointer is on the EGS screen, all key codes are redirected
  50.  * to the screen, too.
  51.  *
  52.  * EGS screens have a message system on their own so that applications with
  53.  * input processing can lack any window without losing multitasking
  54.  * capabilities.
  55.  */
  56.  
  57. /****** EGS - Memory ********************************************************/
  58.  
  59. /*
  60.  * EMemNode, EMemPtr
  61.  * EGS implements an own memory management system that is optimized for large
  62.  * consecutive pieces of memory which are requiered for display driver
  63.  * needs. These memory system is intended to be used by display driver
  64.  * implementors to make optimal use of ther video memory.
  65.  *
  66.  * Graphics memory on the boards is allocated by the procedure AllocEMem.
  67.  * The memory segments are held in EMemNode list structures.  As graphic
  68.  * boards use almost only big consecutive segments, the EGS libraries incorporates
  69.  * memory management routines that can move memory in its address location.  To
  70.  * inhibit memory running away while being used, the EMemNode must be locked
  71.  * by incrementing "lock", e.g. when loading "dest" into any address register.
  72.  * "lock" must be decremented after memory access.  The address of the
  73.  * allocated graphics memory is located in the "dest" field.
  74.  * Only the fields "dest" and "lock" are public, all other fields are
  75.  * strictly private.  Example:
  76.  *
  77.  * EMemNode mem;
  78.  * ...
  79.  * mem.lock++;               now mem.dest may be used
  80.  * *mem.dest = $AA;
  81.  * ...(further memory accesses)...
  82.  * mem.lock--;               now mem.dest may not be used any longer
  83.  */
  84.  
  85. /*
  86.  
  87.    To access the "lock" component, you would have to use
  88.    "mynode.lock.false.lock", which is simply disgusting !
  89.  
  90.  struct E_EMemNode {
  91.                          APTR Dest;
  92.                          union {
  93.                                 struct {
  94.                                         BYTE Lock;
  95.                                         UBYTE Display;
  96.                                         } false;
  97.                                 struct {
  98.                                         UWORD Moveable;
  99.                                         } true;
  100.                                 } Lock;
  101.  
  102.                         UWORD Pad_1;
  103.                         LONG Size;
  104.                         APTR Next, Prev;
  105.  
  106.                    };
  107.  
  108.    But as "moveable" is private to the EGS library, I just ignore the
  109.    memory variation.  If you want to test for moveability then test both
  110.    "lock" and "display".
  111.  
  112. */
  113.  
  114. typedef struct E_EMemNode *E_EMemPtr;
  115.  
  116. struct E_EMemNode {
  117.         APTR      Dest;
  118.         BYTE      Lock;
  119.         UBYTE     Display;
  120.         UWORD     Pad_1;
  121.         LONG      Size;
  122.         E_EMemPtr Next, Prev;
  123.         APTR      MemDest;
  124.         LONG      MemDisp;
  125. };
  126.  
  127. /*
  128.  * An EMemPool is an opaque structure that controls the allocation of
  129.  * video memory. It is allocated by library calls, and must be passed to
  130.  * the appropriate allocation functions to allocate memory on a
  131.  * graphics board.
  132.  */
  133.  
  134. typedef VOID *E_EMemPoolPtr;
  135.  
  136.  
  137. /****** EGS - Objects ********************************************************/
  138.  
  139.  
  140. /*
  141.  * An E_Symbol is an opaque 4 byte unique descriptor of a string. It a value
  142.  * in which is the unique for every process that uses the EGS system. It is
  143.  * internal composed out of a hash value and an unique identifier part, so it's
  144.  * a optimal suited to be used in dictionaries.
  145.  */
  146.  
  147. typedef VOID *E_Symbol;
  148.  
  149. /*
  150.  * The E_EGSObject is the base object type of the EGS object system. It is
  151.  * empty, that it can be used as predecessors to any existing structure.
  152.  * The ISA pointer (the pointer to the objects class) is located at offset
  153.  * minus four, so that creation and destrcution of objects may only be done
  154.  * by library calls or message sends to their class.
  155.  * This structure should have been the prefix of all EGS objects, but as
  156.  * our C compiler refuses to operate with empty structs, it appears only
  157.  * as a comment.
  158.  */
  159.  
  160. typedef VOID E_EGSObject;
  161.  
  162. typedef E_EGSObject *E_EGSObjectPtr;
  163.  
  164. struct E_PublicEGSObject {
  165.         /* E_EGSObject */
  166.         LONG      UseCount;
  167.         struct    SignalSemaphore Lock;
  168.         WORD      Pad0;
  169.         E_Symbol  Name;
  170. };
  171.  
  172. typedef struct E_PublicEGSObject *E_PublicEGSObjectPtr;
  173.  
  174.  
  175. /*
  176.  * The E_EGSObjMsg is a header of all messages in the EGS object system.
  177.  * The fields "Self" and "Method" are filled if the message is dispatched by
  178.  * using E_Dispatch. For shortcut invocation, the fields have to be filled
  179.  * by the calling routine.
  180.  * Every extended message needs this part as a prefix.
  181.  */
  182.  
  183. struct E_EGSObjMsg {
  184.         E_EGSObjectPtr  Self;           /* Receiver           */
  185.         E_Symbol        Method;         /* Method identifier  */
  186. };
  187.  
  188. typedef struct E_EGSObjMsg *E_EGSObjMsgPtr;
  189.  
  190. /*
  191.  * The calling conventiosn for an E_EGSCall are
  192.  *    A2 the message
  193.  *    A1 the contents of the associated data field
  194.  * All registers except A4 are scratch.
  195.  */
  196.  
  197. typedef void (*E_EGSCall)();
  198.  
  199. /*
  200.  * should be:
  201.  *
  202.  * typedef void __asm (*E_EGSCall)(register __a1 APTR, register __a2 E_EGSObjMsgPtr);
  203.  */
  204.  
  205. struct E_EGSMethod {
  206.         APTR            Data;   /* Method implementor specific */
  207.         E_EGSCall       Call;   /* The method itself           */
  208. };
  209.  
  210. typedef struct EGSMethod *E_EGSMethodPtr;
  211.  
  212. /*
  213.  * An EGS class contains the class specific information of all EGS objects
  214.  * of this class. All classes have their own class, called a metaclass.
  215.  * Classes are created by library calls or by messages to their
  216.  * metaclass. The metaclass contains the methods for adding new methods
  217.  * or creating a subclass. The class of metaclasses is always classclass.
  218.  *
  219.  * Classes can be public or private. Public classes can be used by every
  220.  * user of the EGS system. Bitmap types are an example for public classes.
  221.  * Public classes are loaded and initialized on a request if they are not
  222.  * in the system. Alternatively they can be created by user programs
  223.  * and then their can be made public.
  224.  */
  225.  
  226. typedef struct  E_EGSClass *E_EGSClassPtr;
  227.  
  228. struct E_EGSClass {
  229.         struct E_PublicEGSObject  Object;        /* All EGS classes are
  230.                                                   * also objects.
  231.                                                   */
  232.         LONG                      ObjectSize;     /* The size of an instance */
  233.         E_EGSClassPtr             Super;          /* The superclass          */
  234.         struct E_EGSMethod        Create,         /* private shortcuts       */
  235.                                   Delete,
  236.                                   AddMethod;
  237. };
  238.  
  239. /*
  240.  * This is the basic type of a "creation" message. It is sent to a class to
  241.  * create new object of this class. If the creation fails, the result should
  242.  * be NULL. This message is also sent by a call to E_CreateObject.
  243.  */
  244.  
  245. #define E_CreateName            "create"
  246.  
  247. struct E_CreateMsg {
  248.         struct E_EGSObjMsg      ObjMsg;         /* Message header          */
  249.         APTR                    Obj;            /* The resulting object    */
  250. };
  251.  
  252. typedef struct E_CreateMsg *E_CreateMsgPtr;
  253.  
  254. /*
  255.  * This is the message type of a "deletion" message. The object itself will
  256.  * be deleted. This message is also sent by a call to E_DeleteObject.
  257.  */
  258.  
  259. #define E_DeleteName            "delete"
  260.  
  261. struct  E_DeleteMsg {
  262.         struct E_EGSObjMsg      ObjMsg;         /* Message header         */
  263. };
  264.  
  265. typedef struct DeleteMsg *DeleteMsgPtr;
  266.  
  267. /*
  268.  * This is the message to be used to add a method to an existing class.
  269.  * It will eventually replace an already existing method. Subclasses will
  270.  * only be affected, if they had no message of the new type before.
  271.  * This message is also sent by E_AddMethod.
  272.  */
  273.  
  274. #define E_AddMethodName         "addMethod"
  275.  
  276. struct E_AddMethodMsg {
  277.         struct E_EGSObjMsg      ObjMsg;         /* Message header         */
  278.         E_Symbol                Name;           /* The Method name        */
  279.         E_EGSCall               Call;           /* The routine            */
  280.         APTR                    Data;           /* Implementor data       */
  281. };
  282.  
  283. typedef struct E_AddMethodMsg *E_AddMethodMsgPtr;
  284.  
  285. /*
  286.  * Array item for class bulk initialization.
  287.  */
  288.  
  289. struct E_MethodList {
  290.         char            *Name;
  291.         E_EGSCall       Call;
  292. };
  293.  
  294. typedef struct E_MethodList *E_MethodListPtr;
  295.  
  296. /*
  297.  * Message type for requesting a class to create a subclass of itself.
  298.  */
  299.  
  300. #define E_CreateSubClassName    "createSubClass"
  301.  
  302. struct E_CreateSubClassMsg {
  303.         struct E_EGSObjMsg      ObjMsg;         /* Message header         */
  304.         LONG                    ObjectSize,     /* The size of an instance
  305.                                                  * of the new class
  306.                                                  */
  307.                                 ClassSize;      /* The size of the class
  308.                                                  * container of the new
  309.                                                  * class.
  310.                                                  */
  311.         E_EGSClassPtr           Class;          /* Results the new classs,
  312.                                                  * if successful, NULL
  313.                                                  * else
  314.                                                  */
  315. };
  316.  
  317.  
  318. typedef struct CreateSubClassMsg *E_CreateSubClassMsgPtr;
  319.  
  320.  
  321. /*
  322.  * The name of the rootclass of all classes. The class itself maybe
  323.  * obtained by using E_GetSymbol and E_ObtainPublicClass.
  324.  */
  325.  
  326. #define E_ObjectClassName       "Object.class"
  327. #define E_PubObjectClassName    "PubObject.class"
  328.  
  329. /*
  330.  * The baseclass of all classes, and also the class of all
  331.  * metaclasses.
  332.  */
  333.  
  334. #define E_ClassClassName        "Class.class"
  335.  
  336.  
  337. /******** EGS - Colors  *******************************************************/
  338. /*
  339.  * CLUEntry, CLU, CLUPtr
  340.  *
  341.  * The color lookup table. The range of a color component (red, green or
  342.  * blue) is 0 to 255, which means all 8 bits are used. The number of necessary
  343.  * table entries depends on the selected screen depth. If the CLUT is too
  344.  * short, the missing colors are selected by random. If no CLUT is
  345.  * specified for a screen, a standard CLUT is generated.
  346.  */
  347.  
  348. struct E_CLUEntry {
  349.               UBYTE     Red,
  350.                         Green,
  351.                         Blue,
  352.                         Alpha;
  353.                   };
  354.  
  355. typedef struct E_CLUEntry E_CLU;
  356. typedef E_CLU *E_CLUPtr;
  357.  
  358. /******** EGS - Input   *******************************************************/
  359. /*
  360.  * EDCMPFlags, EDCMPFlagSet, EGSMsgPtr, EGSMessage
  361.  *
  362.  * Structures for the message system working on the EScreen level. Thus
  363.  * mouse and character input can be gained without opening a window.
  364.  *
  365.  * EDCMPFlags:
  366.  *   eMOUSEBUTTONS  : Mouse buttons were pressed
  367.  *   eMOUSEMOVE     : Mouse was moved
  368.  *   eRAWKEY        : Key code from the keyboard
  369.  *   eINTUITICK     : Timer is calling
  370.  *   eDISKINSERTED  : Disk was inserted
  371.  *   eDISKREMOVED   : Disk was removed
  372.  *   eNEWPREFS      : Preferences have been changed
  373.  *   eLEAVEVERIFY   : The pointer requests to leave your screen
  374.  *                    has to be replied with okOk or okCancel in order
  375.  *                    to permit or forbid the migration.
  376.  *   eENTERSCREEN   : The pointer just entered your screen
  377.  *
  378.  *  .Class          : Type of the message
  379.  *  .Code           : Message code (refer to  "InputEvents")
  380.  *  .Qualifier      : Message code (refer to  "InputEvents")
  381.  *  .IAddress       : (For E_eRAWKEY: Pointer to deadkey array )
  382.  *  .MouseX,
  383.  *  .MouseY         : Mouse position
  384.  *  .Second,
  385.  *  .Micros         : Event time
  386.  *  .EdcmpScreen    : Screen sending the message
  387.  *  .Tablet         : Tabletdata
  388.  */
  389.  
  390. /* Corresponding EDCMPFlagSet has 32 bits ! */
  391.  
  392. #define E_eMOUSEBUTTONS 0x00000001
  393. #define E_eMOUSEMOVE    0x00000002
  394. #define E_eRAWKEY       0x00000004
  395. #define E_eTIMETICK     0x00000008
  396. #define E_eDISKINSERTED 0x00000010
  397. #define E_eDISKREMOVED  0x00000020
  398. #define E_eNEWPREFS     0x00000040
  399. #define E_eLEAVEVERIFY  0x00000080
  400. #define E_eENTERSCREEN  0x00000100
  401.  
  402. #define E_TABLETA_Dummy         (TAG_USER + 0x3A000)
  403. #define E_TABLETA_TabletZ       (E_TABLETA_Dummy + 0x01)
  404. #define E_TABLETA_RangeZ        (E_TABLETA_Dummy + 0x02)
  405. #define E_TABLETA_AngleX        (E_TABLETA_Dummy + 0x03)
  406. #define E_TABLETA_AngleY        (E_TABLETA_Dummy + 0x04)
  407. #define E_TABLETA_AngleZ        (E_TABLETA_Dummy + 0x05)
  408. #define E_TABLETA_Pressure      (E_TABLETA_Dummy + 0x06)
  409. #define E_TABLETA_ButtonBits    (E_TABLETA_Dummy + 0x07)
  410. #define E_TABLETA_InProximity   (E_TABLETA_Dummy + 0x08)
  411.  
  412. struct E_TabletData {
  413.         UWORD           XFraction, YFraction;   /* Tablet sub pixel
  414.                                                  * coordinates
  415.                                                  */
  416.         ULONG           TabletX, TabletY;       /* Absolute corrdinates on
  417.                                                  * the tablet
  418.                                                  */
  419.         ULONG           RangeX, RangeY;         /* The tablet's coordinate
  420.                                                  * range.
  421.                                                  */
  422.         struct TagItem  *TagList;               /* Extended tablet data
  423.                                                  * as supplied by the tablet
  424.                                                  * driver.
  425.                                                  */
  426. };
  427. typedef struct E_TabletData *E_TabletDataPtr;
  428.  
  429. typedef struct E_EScreen       *E_EScreenPtr;    /* see struct E_EScreen at
  430.                                                   * the bottom
  431.                                                   */
  432.  
  433. struct E_EGSMessage {
  434.         struct Message          Msg;            /* has long word size      */
  435.         ULONG                   Class;          /* The type of the message */
  436.         UWORD                   Code;           /* key code or else        */
  437.         UWORD                   Qualifier;      /* qualifiers              */
  438.         APTR                    IAddress;       /* extended information    */
  439.         WORD                    MouseX, MouseY; /* current pointer location*/
  440.         ULONG                   Seconds, Micros;/* current time            */
  441.         E_EScreenPtr            E_edcmpScreen;  /* messaging screen        */
  442.         LONG                    DoubleDead;
  443.         struct E_TabletData     Tablet;
  444.                                                 /* extended tablet data,
  445.                                                  * check for NULL          */
  446. };
  447.  
  448. typedef struct E_EGSMessage *E_EGSMsgPtr;
  449.  
  450.  
  451. /******** EGS - BitMap *******************************************************/
  452.  
  453. /*
  454.  * E_Pattern, array for monochrome or bichromatic pattern fills
  455.  */
  456.  
  457. typedef WORD    E_Pattern[16];
  458. typedef E_Pattern *E_PatternPtr;
  459.  
  460. typedef ULONG E_ColorTable;
  461. typedef E_ColorTable *E_ColorTablePtr;
  462.  
  463. struct  E_Image {
  464.          WORD       Width,
  465.                     Height,
  466.                     Depth,
  467.                     Pad;
  468.          APTR       Planes[8];
  469. };
  470.  
  471. typedef struct E_Image *E_ImagePtr;
  472.  
  473. /*
  474.  * MinTerms for blit operations on pseudo color screens.
  475.  */
  476.  
  477. #define E_nSRC_nDST   0x00000001
  478. #define E_nSRC_DST    0x00000002
  479. #define E_SRC_nDST    0x00000004
  480. #define E_SRC_DST     0x00000008
  481.  
  482. /*
  483. ** For Bitmap OR BitMap set (E_nSRC_DST | E_SRC_nDST | E_SRC_DST)
  484. */
  485.  
  486. /*
  487.  * EBitMapPtr, EBitMap
  488.  *
  489.  * Basic structure for management of graphics memory.
  490.  *
  491.  * As different graphic boards exist which have different memory organisations
  492.  * the egs libraries offer several different bitmap types.
  493.  *
  494.  * These are the fields that have the same meaning in any bitmap:
  495.  *
  496.  *  .Width       : Pixel Width.
  497.  *  .Height      : Pixel Height.
  498.  *  .BytesPerRow : Number of bytes per row.
  499.  *  .Depth       : Number of bits for one pixel; though in 24 bit mode (real)
  500.  *                 the number 24 is contained herein, always 32 bits
  501.  *                 (one longword)
  502.  *
  503.  *  .Type        : Type ot the Bitmap. Currently these types exist:
  504.  *
  505.  *  E_PIXELMAP      : The memory format is chunky which means that the bits that
  506.  *                    build up one pixel lay in adjacent memory locations.
  507.  *                    E.g. 2 bits : aabbccdd eeffgghh iijjkkll ...
  508.  *                    The organisation in 24 bit is RGBx. This is the native EGS
  509.  *                    bitmap type. You can always get a map of this type in
  510.  *                    24 bits. The functions in EGSblit are always able to work
  511.  *                    with this bitmap and convert from and to other 24 bit
  512.  *                    formats, or to other bit depths.
  513.  *                    The real location in memory is
  514.  *
  515.  *                            ..->Typekey.PixelMap.Planes.Dest
  516.  *
  517.  *                       or
  518.  *
  519.  *                            ..->Plane
  520.  *
  521.  *                    The memory has to be locked before it is accessed or the
  522.  *                    pointer to it is used, as the libraries are able to move
  523.  *                    parts of the graphics memory to gain longer fragments.
  524.  *                    To lock increment the lock field; to unlock, decrement it
  525.  *                    again. This lock does not guarantee exclusive access; it
  526.  *                    only guarantees, that the bitmap ist not moved.
  527.  *
  528.  *  E_PIXLACEMAP    : Some graphic boards have in interlaced a splitted memory
  529.  *                    which means that the odd and the even field of the display
  530.  *                    reside in different memory locations. The format is the
  531.  *                    same as E_PIXELMAP, with one exception. The even lines
  532.  *                    are in one block and the odd lines are in one block. The
  533.  *                    starting location of the odd field is
  534.  *
  535.  *                      ..->Typekey.PixelMap.Planes.Dest+
  536.  *                       ..->Typekey.PixelMap.IntDisp
  537.  *
  538.  *  E_BITPLANEMAP   : The bits that build each pixel are spread over several
  539.  *                    bitplanes.
  540.  *
  541.  *  E_USERMAP       : Nothing is known about the structure of the frame store.
  542.  *
  543.  *  E_PIXELMAP_xRGB : Same as E_PIXELMAP, except that the format in 24 bit is
  544.  *                    xRGB and not RGBx.
  545.  *  E_LOCKED_...    : Same as their pendants, except that they require a
  546.  *                    lock and unlock arbitration through a message call.
  547.  *  E_SELECT_B...   : The plane to work on has to be selected by a message
  548.  *                    call, and than appears in ..Plane1. Locking and
  549.  *                    unlocking has to be done like in E_LOCKED_...
  550.  *
  551.  * Your programms should be able to handle at least the E_PIXELMAP 24 format.
  552.  * If it can't handle the format it is given, use the routines of the
  553.  * EGSblit.library or the direct method calls.
  554.  * If you need a bitmap for double buffering you should use the bitmap from
  555.  * your screen as friend bitmap and the flag E_EB_DISPLAYABLE.
  556.  *
  557.  * All fields in the bitmap structure (except of .Lock) are read only. It is
  558.  * highly discouraged, to modify any fields. If you need a bitmap for an
  559.  * existing block of memory, you may call E_AllocBitMapFrame to allocate
  560.  * and initialize an empty bitmap frame. You may then put your own bitmap
  561.  * pointer into the appropriate fields. You may not delete such a bitmap
  562.  * using E_DisposeBitMap, instead you have to call E_DisposeBitMapFrame, and
  563.  * free your image memory on your own account.
  564.  *
  565.  * For reasons of compatibility with existing applications and easyness of use
  566.  * there are two restricted tasks that may be performed by an application
  567.  * created bitmap.
  568.  *
  569.  *   1. An application created 24 bit E_PIXELMAP may be copied to any
  570.  *      EGS bitmap using EB_CopyBitMap or EG_CopyBitMapRastPort.
  571.  *
  572.  *   2. An application created 1 bit E_PIXELMAP may be used as a mask in
  573.  *      mask related operations like EB_FillMask, EG_FillMask or
  574.  *      EG_FillMaskSeg
  575.  *
  576.  * You may not perform any other type of blit operation on your application
  577.  * created bitmap. You have to initialize the fields .Width, .Height, .Depth,
  578.  * .Type, .Plane. and .bytesPerRow.
  579.  *
  580.  */
  581.  
  582. /*
  583.  * Standard bitmap types. All other bitmaps are customer defined.
  584.  */
  585.  
  586. #define E_PIXELMAP                      0
  587. #define E_PIXLACEMAP                    1
  588. #define E_BITPLANEMAP                   2
  589. #define E_USERMAP                       3
  590. #define E_PIXELMAP_xRGB                 4
  591. #define E_LOCKED_PIXELMAP               5
  592. #define E_LOCKED_BITPLANEMAP            6
  593. #define E_SWAPED_PIXELMAP               7
  594. #define E_LOCKED_SWAPED_PIXELMAP        8
  595. #define E_PACKED_PIXELMAP               9
  596. #define E_LOCKED_PACKED_PIXELMAP        10
  597. #define E_SELECT_BITPLANEMAP            11
  598. #define E_LOCKED_PIXLACEMAP             12
  599. #define E_LOCKED_PIXELMAP_xRGB                13
  600. #define    E_SEGMENT_PIXELMAP                    14
  601. #define    E_SEGMENT_PACKED_PIXELMAP          15
  602. #define    E_SWAPED_PACKED_PIXELMAP           16
  603. #define E_SEG_SWAPED_PACKED_PIXELMAP       17
  604. #define E_UNKNOWNMAP                    18
  605.  
  606. /*
  607.  * E_EBitMap Flags
  608.  */
  609.  
  610. #define E_EB_DISPLAYABLE      0x00000001    /* This bitmap is intended to be
  611.                                              * displayed. This will place
  612.                                              * some restriction on the
  613.                                              * bitmap (eg. its size).
  614.                                              * This flag is only usefull,
  615.                                              * if used together with a friend
  616.                                              * bitmap
  617.                                              */
  618.  
  619. #define E_EB_BLITABLE         0x00000002    /* This bitmap should be placed in
  620.                                              * such memory that it easily can
  621.                                              * be blitted to and from its
  622.                                              * friend bitmap
  623.                                              */
  624. #define E_EB_SWAPABLE         0x00000004
  625. #define E_EB_NOTSWAPABLE      0x00000008
  626. #define E_EB_CLEARMAP         0x00000010    /* The bitmap is to be cleared after
  627.                                              * allocation
  628.                                              */
  629.  
  630. typedef struct E_EBitMap       *E_EBitMapPtr;
  631.  
  632. typedef struct E_EBitMapClass  *E_EBitMapClassPtr;
  633.  
  634.  
  635. /*
  636.  * original version,
  637.  */
  638. struct E_EBitMapFull {
  639.  
  640.              /* struct E_EGSObject     ObjMsg; */
  641.                 WORD                   Width, Height,
  642.                                        BytesPerRow;
  643.                 BYTE                   Depth;
  644.                 UBYTE                  Type;
  645.  
  646.   /* Enumeration type descriptor for access to union fields */
  647.  
  648.                 union {
  649.  
  650.                         struct {
  651.                                  struct   E_EMemNode Planes;
  652.                                  ULONG               IntDisp;
  653.                                    } PixelMap;
  654.  
  655.                         struct {
  656.  
  657.                                 APTR      BitPlane0;
  658.                                 BYTE      Lock;
  659.                                 UBYTE     Display;
  660.                                             UWORD     Pad0;
  661.                                             ULONG        Pad1;
  662.                                             APTR      BitPlanes[24];
  663.                                    } BitPlaneMap;
  664.  
  665.                         struct {
  666.                                 APTR   Action;
  667.                                 } UserMap;
  668.  
  669.                         } Typekey;
  670.  
  671.                  E_CLUPtr              Colors;
  672.                  ULONG                 Flags; /* E_EBitMapFlagSet */
  673.                  E_EBitMapClassPtr     Class;
  674.                   };
  675.  
  676. /*
  677.  * simplified, as c has its problems with union types.
  678.  */
  679.  
  680. struct E_EBitMap {
  681.     /*  struct E_EGSObject      Object; */
  682.         WORD                    Width, Height;  /* bitmap dimensions in units
  683.                                                  * of pixel
  684.                                                  */
  685.         UWORD                   BytesPerRow;    /* bytes in one row of the
  686.                                                  * bitmap, this may differ for
  687.                                                  * different bitmap types,
  688.                                                  * especially for displayable
  689.                                                  * maps. So it's unwise to make
  690.                                                  * any assumptions about
  691.                                                  * relations between Width/
  692.                                                  * Depth and BytesPerRow.
  693.                                                  */
  694.         BYTE                    Depth;          /* number of bits for one
  695.                                                  * pixel in the bitmap.
  696.                                                  */
  697.         UBYTE                   Type;           /* public or private type of
  698.                                                  * the bitmap. If you check
  699.                                                  * this, and obey the bitmaps
  700.                                                  * rules, you may access some
  701.                                                  * bitmap types directly
  702.                                                  */
  703.         APTR                    Plane;          /* In chunky map types like
  704.                                                  * E_PIXELMAP, this is the
  705.                                                  * address of the first pixel
  706.                                                  * in memory. In plane
  707.                                                  * oriented bitmaps this is
  708.                                                  * a clone of the pointer to
  709.                                                  * the first plane. Therefore
  710.                                                  * single bit chunky can be
  711.                                                  * used the same way as
  712.                                                  * single bit plane.
  713.                                                  */
  714.         BYTE                    Lock;           /* Lockvalue in bitmaps with
  715.                                                  * simple locking schemes.
  716.                                                  */
  717.         UBYTE                   Display;
  718.            UWORD                   Pad0;
  719.            ULONG                            Pad1;
  720.            APTR                    BitPlanes[24];  /* In bitplane oriented maps
  721.                                                  * this is where the
  722.                                                  * addresses of the planes
  723.                                                  * are stored
  724.                                                  */
  725.         E_CLUPtr                Colors;         /* If the bitmap has an own
  726.                                                  * or shared colormap, it
  727.                                                  * will be found here, or
  728.                                                  * NULL else. If a bitmap is
  729.                                                  * allocated using a friend,
  730.                                                  * it will share its friend's
  731.                                                  * colormap.
  732.                                                  */
  733.         ULONG                   Flags;          /* See E_EB_.. */
  734.         E_EBitMapClassPtr       Class;          /* A copy of the bitmaps class
  735.                                                  * for simplified access
  736.                                                  */
  737. };
  738.  
  739. /* Access example:
  740.  *
  741.  *   E_EBitMapPtr Ptr;
  742.  *   APTR Plane, Otherplane;
  743.  *
  744.  *   if (Ptr->Type == E_BITPLANEMAP)
  745.  *     {
  746.  *     Plane = Ptr->BitPlanes[someindex];
  747.  *     }
  748.  *   if (Ptr-Type == E_PIXELMAP)
  749.  *     {
  750.  *     Otherplane = Ptr->Plane;
  751.  *     }
  752.  *
  753.  */
  754.  
  755.  
  756. /*
  757.  * Message to be used for single pixel operations like "ReadPixel" or
  758.  * "WritePixel".
  759.  */
  760.  
  761. struct E_PixelMsg {
  762.  
  763.         struct E_EGSObjMsg     ObjMsg;      /* Message header             */
  764.         E_EBitMapPtr           Map;         /* The affected map           */
  765.         LONG                   Color;
  766.                                              /* The color to be used, or
  767.                                              * returned. May be either
  768.                                              * the pixel value or an
  769.                                              * 24 bit color value. On calls
  770.                                              * to "ReadPixel24" this is
  771.                                              * guaranted to return the
  772.                                              * 'real' color
  773.                                              */
  774.  
  775.         WORD                   X,Y;         /* Coordinates in pixels      */
  776. };
  777.  
  778. typedef struct E_PixelMsg *E_PixelMsgPtr;
  779.  
  780. /*
  781.  * Message for line drawing operations. It is not likely to be used,
  782.  * instead you should make calls to the drawing operation of EGSblit.
  783.  */
  784.  
  785. struct  E_DrawMsg {
  786.  
  787.         struct E_EGSObjMsg     ObjMsg;      /* Message header             */
  788.         E_EBitMapPtr           Map;         /* The affected map           */
  789.         LONG                   Front,       /* foreground pen or -1 for
  790.                                              * complement
  791.                                              */
  792.                                Back;        /* Background pen or -1 for
  793.                                              * monochrome lines
  794.                                              */
  795.         UWORD                  Patt;        /* line pattern               */
  796.         WORD                   X1,Y1;       /* starting coordinate        */
  797.         WORD                   X2,Y2;       /* ending coordinate          */
  798.         WORD                   Dx,Dy;       /* extended delta             */
  799.         WORD                   Sum;         /* start sum for Bresenham   */
  800. };
  801.  
  802. typedef struct E_DrawMsg *E_DrawMsgPtr;
  803.  
  804. /*
  805.  * Message for copying and conversion from rectangular areas
  806.  */
  807.  
  808. struct E_CopyBitMapMsg {
  809.  
  810.         struct E_EGSObjMsg     ObjMsg;      /* Message header             */
  811.         E_EBitMapPtr           Src;         /* source bitmap              */
  812.         E_EBitMapPtr           Dst;         /* destination bitmap         */
  813.         WORD                   Sx,Sy;       /* top left coordinate in the
  814.                                              * source bitmap
  815.                                              */
  816.         WORD                   W,H;         /* width and height of the
  817.                                              * rectangular area
  818.                                              */
  819.         WORD                   Dx,Dy;       /* top left coordinate in the
  820.                                              * destination bitmap
  821.                                              */
  822. };
  823.  
  824. typedef struct E_CopyBitMapMsg  *E_CopyBitMapMsgPtr;
  825.  
  826. /*
  827.  * Message for rectangular and masked fill operations
  828.  */
  829.  
  830. struct E_RectFillMsg {
  831.  
  832.         struct E_EGSObjMsg     ObjMsg;      /* Message header             */
  833.         E_EBitMapPtr           Map;         /* destination bitmap         */
  834.         E_EBitMapPtr           Mask;        /* optional single pixel mask
  835.                                              * bitmap, must be either of
  836.                                              * type E_PIXELMAP or
  837.                                              * E_BITPLANEMAP.
  838.                                              */
  839.         E_EBitMapPtr           MPatt;       /* multicolor pattern, should be
  840.                                              * a friend bitmap of the
  841.                                              * destination bitmap
  842.                                              */
  843.         E_PatternPtr           Patt;        /* mono- or bichromatic fill-
  844.                                              * pattern
  845.                                              */
  846.         LONG                   Front,       /* foreground pen, or -1
  847.                                              * for complement mode
  848.                                              */
  849.                                Back;        /* background pen, or -1 for
  850.                                              * transparent monochromatic
  851.                                              * pattern
  852.                                              */
  853.         WORD                   Sx,Sy;       /* top left coordinates in the
  854.                                              * mask
  855.                                              */
  856.         WORD                   W,H;         /* width and height of the
  857.                                              * rectangle to be filled
  858.                                              */
  859.         WORD                   Dx,Dy;       /* top left coordinates in the
  860.                                              * destination bitmap
  861.                                              */
  862.         WORD                   Ox,Oy;       /* top left offset of the
  863.                                              * multicolor pattern
  864.                                              */
  865. };
  866.  
  867. typedef struct E_RectFillMsg *E_RectFillMsgPtr;
  868.  
  869. /*
  870.  * Message for unpacking from packed bitplane images
  871.  */
  872.  
  873. struct  E_UnpackMsg {
  874.  
  875.          struct E_EGSObjMsg   ObjMsg;       /* Message header             */
  876.          E_EBitMapPtr         Map;          /* destination bitmap         */
  877.          E_ImagePtr           Image;        /* the image to be unpacked   */
  878.          E_ColorTablePtr      Colors;       /* image colors               */
  879. };
  880.  
  881. typedef  struct E_UnpackMsg *E_UnpackMsgPtr;
  882.  
  883.  
  884. /*
  885.  * Message for extracting a single color of a bitmap
  886.  */
  887.  
  888. struct E_ExtractColorMsg {
  889.  
  890.          struct E_EGSObjMsg   ObjMsg;       /* Message header             */
  891.          E_EBitMapPtr         Src;          /* source bitmap              */
  892.          E_EBitMapPtr         Dst;          /* single bit destination map;
  893.                                              * May be either of type
  894.                                              * E_PIXELMAP or E_BITPLANEMAP.
  895.                                              */
  896.          LONG                 Color;        /* the color to be extracted  */
  897.          WORD                 Sx,Sy;        /* top left coordinates in the
  898.                                              * source bitmap
  899.                                              */
  900.          WORD                 W,H;          /* width and height of the
  901.                                              * rectangle to be affected
  902.                                              */
  903.          WORD                 Dx,Dy;        /* top left coordinates in
  904.                                              * the destination map
  905.                                              */
  906. };
  907.  
  908. typedef  struct E_ExtractColorMsg *E_ExtractColorMsgPtr;
  909.  
  910. /*
  911.  * Message for bitmap clearing
  912.  */
  913.  
  914. struct  E_ClearMsg  {
  915.  
  916.          struct E_EGSObjMsg   ObjMsg;       /* Message header             */
  917.          E_EBitMapPtr         Map;          /* the affected map           */
  918. };
  919.  
  920. typedef struct E_ClearMsg *E_ClearMsgPtr;
  921.  
  922. /*
  923.  * Message to access a line of memory in segmented bitmaps
  924.  */
  925.  
  926. struct  E_SelectLinePtrMsg {
  927.  
  928.          struct E_EGSObjMsg   ObjMsg;       /* Message header             */
  929.          E_EBitMapPtr         Map;          /* the used map               */
  930.          WORD                 Line,Pad0;    /* the number of the requested
  931.                                              * line, zero for topline
  932.                                              */
  933.          APTR                 Ptr;          /* resulting pointer to line  */
  934. };
  935.  
  936. typedef struct E_SelectLinePtrMsg *E_SelectLinePtrMsgPtr;
  937.  
  938. /*
  939.  * Message for locking and unlocking of bitmaps
  940.  */
  941.  
  942. struct  E_LockMapMsg {
  943.  
  944.          struct E_EGSObjMsg   ObjMsg;       /* Message header             */
  945.          E_EBitMapPtr         Map;          /* the used map               */
  946. };
  947.  
  948. typedef struct  E_LockMapMsg *E_LockMapMsgPtr;
  949.  
  950. /*
  951.  * Messgae for bitmap allocation
  952.  */
  953.  
  954. struct E_AllocBitMapMsg {
  955.  
  956.          struct E_EGSObjMsg   ObjMsg;       /* Message header             */
  957.          E_EBitMapPtr         Map;          /* the resulting map, of NULL
  958.                                              * if failed.
  959.                                              */
  960.          E_EBitMapClassPtr    Class;        /* the class of the requested
  961.                                              * bitmap
  962.                                              */
  963.          WORD                 W,H;          /* requested size of the
  964.                                              * bitmap
  965.                                              */
  966.          ULONG                Flags;        /* flags for the requested
  967.                                              * bitmap E_EB_...
  968.                                              */
  969. };
  970.  
  971. typedef struct E_AllocBitMapMsg *E_AllocBitMapMsgPtr;
  972.  
  973. /*
  974.  * Message for bitmap deletion
  975.  */
  976.  
  977. struct  E_DisposeBitMapMsg {
  978.  
  979.          struct E_EGSObjMsg   ObjMsg;       /* Message header             */
  980.          E_EBitMapPtr         Map;          /* the used map               */
  981. };
  982.  
  983. typedef  struct E_DisposeBitMapMsg *E_DisposeBitMapMsgPtr;
  984.  
  985. /*
  986.  * Message for amiga compatible blits, from EGS bitmap to EGS bitmap.
  987.  */
  988.  
  989. struct  E_BitBltMsg {
  990.  
  991.          struct E_EGSObjMsg   ObjMsg;       /* Message header             */
  992.          E_EBitMapPtr         Src;          /* source bitmap              */
  993.          E_EBitMapPtr         Dst;          /* destination bitmap         */
  994.          WORD                 Sx,Sy;        /* top left of source         */
  995.          WORD                 W,H;          /* dimension                  */
  996.          WORD                 Dx,Dy;        /* top left of destination    */
  997.          UBYTE                Terms;        /* blit minterms              */
  998.          UBYTE                Mask;         /* 'planes' to be affected    */
  999.          WORD                 Pad0;
  1000. };
  1001.  
  1002. typedef  struct E_BitBltMsg *E_BitBltMsgPtr;
  1003.  
  1004. /*
  1005.  * Mesage for amiga compatible blits, from/to EGS bitmap and bitplanes
  1006.  */
  1007.  
  1008. struct E_BitBltPlaneMsg {
  1009.  
  1010.          struct E_EGSObjMsg   ObjMsg;       /* Message header             */
  1011.          E_EBitMapPtr         Map;          /* the EGS bitmap in the blit */
  1012.          WORD                 Depth;        /* number of bitplanes        */
  1013.          APTR                 Planes[8];    /* the planes themself        */
  1014.          WORD                 BytesPerRow;  /* bytes per row in planes    */
  1015.          WORD                 Sx,Sy;        /* top left of source         */
  1016.          WORD                 W,H;          /* dimensions                 */
  1017.          WORD                 Dx,Dy;        /* top left of destination    */
  1018.          UBYTE                Terms;        /* blit minterms              */
  1019.          UBYTE                Mask;         /* 'planes' to be affected    */
  1020.          WORD                 Pad0;
  1021. };
  1022.  
  1023. typedef struct E_BitBltPlaneMsg *E_BitBltPlaneMsgPtr;
  1024.  
  1025. /*
  1026.  * Message for selecting of a bitplane in select bitmaps
  1027.  */
  1028.  
  1029. struct E_SelectPlaneMsg {
  1030.  
  1031.          struct E_EGSObjMsg   ObjMsg;       /* Message header             */
  1032.          E_EBitMapPtr         Map;          /* the map itself             */
  1033.          WORD                 Plane;        /* which plane to be selected */
  1034.          WORD                 Pad0;
  1035. };
  1036.  
  1037. typedef struct SelectPlaneMsg *E_SelectPlaneMsgPtr;
  1038.  
  1039. /*
  1040.  * Messages for Zooming
  1041.  */
  1042.  
  1043. struct E_ZoomBitMapMsg {
  1044.  
  1045.  
  1046.         struct E_EGSObjMsg     ObjMsg;      /* Message header             */
  1047.         E_EBitMapPtr           Src;         /* source bitmap              */
  1048.         E_EBitMapPtr           Dst;         /* destination bitmap         */
  1049.         WORD                   Sx,Sy;       /* top left coordinate in the
  1050.                                              * source bitmap
  1051.                                              */
  1052.         WORD                   W,H;         /* width and height of the
  1053.                                              * rectangular area
  1054.                                              */
  1055.         WORD                   Dx,Dy;       /* top left coordinate in the
  1056.                                                             * destination bitmap
  1057.                                                             */
  1058.            WORD                         Zoom;
  1059. };
  1060.  
  1061. typedef struct E_ZoomBitMapMsg *E_ZoomBitMapMsgPtr;
  1062.  
  1063. struct E_ZoomMaskMapMsg {
  1064.  
  1065.         struct E_EGSObjMsg     ObjMsg;      /* Message header             */
  1066.         E_EBitMapPtr           Map;         /* destination bitmap         */
  1067.         E_EBitMapPtr           Mask;        /* optional single pixel mask
  1068.                                              * bitmap, must be either of
  1069.                                              * type E_PIXELMAP or
  1070.                                              * E_BITPLANEMAP.
  1071.                                              */
  1072.         E_EBitMapPtr           MPatt;       /* multicolor pattern, should be
  1073.                                              * a friend bitmap of the
  1074.                                              * destination bitmap
  1075.                                              */
  1076.         E_PatternPtr           Patt;        /* mono- or bichromatic fill-
  1077.                                              * pattern
  1078.                                              */
  1079.         LONG                   Front,       /* foreground pen, or -1 for
  1080.                                              * for complement mode
  1081.                                              */
  1082.                                Back;        /* background pen, or -1 for
  1083.                                              * transparent monochromatic
  1084.                                              * pattern
  1085.                                              */
  1086.         WORD                   Sx,Sy;       /* top left coordinates in the
  1087.                                              * mask
  1088.                                              */
  1089.         WORD                   W,H;         /* width and height of the
  1090.                                              * rectangle to be filled
  1091.                                              */
  1092.         WORD                   Dx,Dy;       /* top left coordinates in the
  1093.                                              * destination bitmap
  1094.                                              */
  1095.         WORD                   Ox,Oy;       /* top left offset of the
  1096.                                              * multicolor pattern
  1097.                                                             */
  1098.            WORD                         Zoom;           /* Zoomfactor */
  1099. };
  1100.  
  1101.  
  1102. /*
  1103.  * The basic class container for all EGS bitmaps. This structure is absolutely
  1104.  * read only, except for bitmap class implementors.
  1105.  *
  1106.  */
  1107.  
  1108. struct  E_EBitMapClass {
  1109.  
  1110.          struct      E_EGSClass     E_EGSClass;       /* class header        */
  1111.          UBYTE                      Type;             /* bitmap type         */
  1112.          BYTE                       Depth;            /* bitmap depth        */
  1113.          WORD                       Pad0;
  1114.          E_CLUPtr                   DitherCLU;        /* pointer for the
  1115.                                                        * initial clut, to
  1116.                                                        * achieve perfect
  1117.                                                        * dithering. NULL for
  1118.                                                        * true color bitmaps,
  1119.                                                        * that do not need
  1120.                                                        * dithering.
  1121.                                                        */
  1122.          WORD                       DitherNum;        /* number of pens, used
  1123.                                                        * for dithering.
  1124.                                                        */
  1125.          UBYTE                      FirstFree;        /* first free pen in the
  1126.                                                        * colormap
  1127.                                                        */
  1128.          UBYTE                      NumFree;          /* number of free pens
  1129.                                                        * in the colormap
  1130.                                                        */
  1131.          struct E_EGSMethod                           /* shortcut calls for
  1132.                                                        * blit methods.
  1133.                                                        */
  1134.                                     ReadPixel,
  1135.                                     ReadPixel24,
  1136.                                     WritePixel,
  1137.                                     Draw,
  1138.                                     CopyBitMap,
  1139.                                     ConvertTo24,
  1140.                                     ConvertFrom24,
  1141.                                     ConvertBitMap,
  1142.                                     RectFill,
  1143.                                     RectFillPatt,
  1144.                                     RectFillMPatt,
  1145.                                     FillMask,
  1146.                                     FillMaskBack,
  1147.                                     FillMaskPatt,
  1148.                                     FillMaskMPatt,
  1149.                                     Unpack,
  1150.                                     ExtractColor,
  1151.                                     Clear,
  1152.                                     AllocBitMap,
  1153.                                     DisposeBitMap,
  1154.                                                 SelectLine,
  1155.                                     ObtainMap,
  1156.                                     ReleaseMap,
  1157.                                     BitBlt,
  1158.                                     BitBltFromPlanes,
  1159.                                     BitBltToPlanes,
  1160.                                     SelectPlane,
  1161.                                     SwapBitMap,
  1162.                                     ZoomBitMap,
  1163.                                     ZoomFrom24,
  1164.                                     ZoomMaskMap;
  1165. };
  1166.  
  1167. /*
  1168.  * Read a pixel in a bitmap. The result is bitmap dependant, and may be
  1169.  * either a 24 bit value or a pen number.
  1170.  */
  1171. #define  E_ReadPixelName        "readPixel"
  1172.  
  1173. /*
  1174.  * Read a true color pixel in a bitmap. The result will be a 24 bit color
  1175.  * value. This call will fail and return -1, if the color can not be
  1176.  * retrieved.
  1177.  */
  1178. #define  E_ReadPixel24Name      "readPixel24"
  1179.  
  1180. /*
  1181.  * Write a single pixel into a bitmap. The used pen may either be a
  1182.  * pen value or a 24 bit color value in the three MSBs. The value -1
  1183.  * is used for complement mode.
  1184.  */
  1185. #define  E_WritePixelName       "writePixel"
  1186.  
  1187. /*
  1188.  * Draw a line using Bresenham's algorithm. You should better use the
  1189.  * calls in EGSblit.
  1190.  */
  1191. #define  E_DrawName             "draw"
  1192.  
  1193. /*
  1194.  * Copy rectangle between two bitmaps of exactly same type and depth.
  1195.  */
  1196. #define  E_CopyBitMapName       "copyBitMap"
  1197.  
  1198. /*
  1199.  * Convert from any bitmap to a 24 bit E_PIXELMAP bitmap
  1200.  */
  1201. #define  E_ConvertTo24Name      "convertTo24"
  1202.  
  1203. /*
  1204.  * Convert from 24 bit E_PIXELMAP bitmap to any bitmap
  1205.  */
  1206. #define  E_ConvertFrom24Name    "convertFrom24"
  1207.  
  1208. /*
  1209.  * Convert from any bitmap to any other bitmap. May take quiet a while,
  1210.  * if the needed conversion is not directly implemented.
  1211.  */
  1212. #define  E_ConvertBitMapName    "convertBitMap"
  1213.  
  1214. /*
  1215.  * Fill a rectangle with solid color
  1216.  */
  1217. #define  E_RectFillName         "rectFill"
  1218.  
  1219. /*
  1220.  * Fill a rectangle with a mono- or bichromatic pattern
  1221.  */
  1222. #define  E_RectFillPattName     "rectFillPatt"
  1223.  
  1224. /*
  1225.  * Fill a rectangle with a multicolor pattern
  1226.  */
  1227. #define  E_RectFillMPattName    "rectFillMPatt"
  1228.  
  1229. /*
  1230.  * Fill a rectangle through a mask with a solid color
  1231.  */
  1232. #define  E_FillMaskName         "fillMask"
  1233.  
  1234. /*
  1235.  * Fill a rectangle through a mask with a solid color, and also fill
  1236.  * the background of the mask
  1237.  */
  1238. #define  E_FillMaskBackName     "fillMaskBack"
  1239.  
  1240. /*
  1241.  * Fill a rectangle through a mask with a mono- or bichromatic pattern
  1242.  */
  1243. #define  E_FillMaskPattName     "fillMaskPatt"
  1244.  
  1245. /*
  1246.  * Fill a rectangle through a mask with a multicolor pattern
  1247.  */
  1248. #define  E_FillMaskMPattName    "fillMaskMPatt"
  1249.  
  1250. /*
  1251.  * Unpack a packed bitplane image
  1252.  */
  1253. #define  E_UnpackName           "unpack"
  1254.  
  1255. /*
  1256.  * Extract a single color out of a bitmap. All matching pixels will be
  1257.  * toggled in the destination mask bitmap.
  1258.  */
  1259. #define  E_ExtractColorName     "extractColor"
  1260.  
  1261. /*
  1262.  * Clear a bitmap with color 0 (in normal cases black)
  1263.  */
  1264. #define  E_ClearName            "clear"
  1265.  
  1266. /*
  1267.  * Zoom a bitmap with an integer factor x, if x is
  1268.  *
  1269.  * <0  : Shrink the image by 1-x
  1270.  * =0  : Copy the image
  1271.  * >0  : Expand the image by 1+x
  1272.  */
  1273. #define E_ZoomBitMapName    "zoomBitMap"
  1274. #define E_ZoomFrom24Name    "zoomFrom24"
  1275.  
  1276. /*
  1277.  * Expand a mask bitmap in a zoomed way
  1278.  */
  1279. #define E_ZoomMaskMapName    "zoomMaskMap"
  1280.  
  1281. /*
  1282.  * Allocate a bitmap, should be used by driver implementors only. For
  1283.  * normal purposes better use E_AllocBitMap or E_AllocBitMapClass.
  1284.  */
  1285. #define  E_AllocBitMapName      "allocBitMap"
  1286. #define  E_DisposeBitMapName    "disposeBitMap"
  1287.  
  1288. /*
  1289.  * Get access to a line in segmented memory bitmaps. This call is
  1290.  * only valid if enclosed in E_ObtainMap and E_ReleaseMap.
  1291.  */
  1292. #define  E_SelectLineName       "selectLine"
  1293.  
  1294. /*
  1295.  * Obtain a bitmap for exclusive access. This is required for several
  1296.  * bitmap types. Reasons may be an synchonous blitter or segemented
  1297.  * memory, or the need to swap bitmaps in and out. Each call of
  1298.  * E_ObtainMap must be matched by a call of E_ReleaseMap.
  1299.  */
  1300. #define  E_ObtainMapName        "obtainMap"
  1301. #define  E_ReleaseMapName       "releaseMap"
  1302.  
  1303. /*
  1304.  * Blit between two EGS bitmaps
  1305.  */
  1306. #define  E_BitBltName           "bitBlt"
  1307.  
  1308. /*
  1309.  * Blit from planes to an EGS bitmap
  1310.  */
  1311. #define  E_BitBltFromPlanesName "bitBltFromPlanes"
  1312.  
  1313. /*
  1314.  * Blit from an EGS bitmap to planes
  1315.  */
  1316. #define  E_BitBltToPlanesName   "bitBltToPlanes"
  1317.  
  1318. /*
  1319.  * Select a bitmap to work in E_SELECT.. bitmaps. This call is only valid
  1320.  * between E_ObtainMap and E_ReleaseMap calls. The pointer to the requested plane
  1321.  * can be found in the "Plane" field.
  1322.  */
  1323. #define  E_SelectPlaneName      "selectPlane"
  1324.  
  1325. /*
  1326.  * Swap a rectangular area between two bitmaps.
  1327.  */
  1328. #define  E_SwapBitMapName       "swapBitMap"
  1329.  
  1330. /*
  1331.  * The name of the rootclass of all bitmap classes. All blit functions
  1332.  * are broken down to simpler functions (E_Read/E_WritePixel in worst
  1333.  * case), so that bitmapclass implementors can focus on the really
  1334.  * needed functions.
  1335.  */
  1336. #define  E_EBitMapClassName      "BitMap.class"
  1337.  
  1338. /************************ EGS - Pointer                    *****************/
  1339.  
  1340. /*
  1341.  * SoftMousePtr, SoftMouse, HardMousePtr, HardMouse
  1342.  *
  1343.  * Data block for the mouse pointer. Three colors can be used. The bits of
  1344.  * a pixel are consecutive as usually, the combination %00 represents a
  1345.  * transparent pixel.
  1346.  *
  1347.  * The maximum size of a software mouse pointer is 32 by 32 pixels.  A hard-
  1348.  * ware mouse pointer can have up to 64 by 64 pixels but that would exceed
  1349.  * the processor capabilities during emulation.
  1350.  *
  1351.  *
  1352.  * EMouse, EMousePtr
  1353.  *
  1354.  * Definition structure for a mouse pointer. Each screen can have only one
  1355.  * mouse pointer at any moment. When switching screens, the pointer is
  1356.  * changed adequately. A screen's mouse pointer can be altered by a function
  1357.  * at any time.
  1358.  *
  1359.  * For graphic boards without a hardware pointer a pointer is emulated by
  1360.  * software. Specified HardMouse structures are used only if a hardware
  1361.  * pointer was implemented, too. If .soft = NULL then the HardMouse structure
  1362.  * is converted into a SoftMouse structure automatically.
  1363.  *
  1364.  *  .Color1       : Colour for %01
  1365.  *  .Color2       : Colour for %10
  1366.  *  .Color3       : Colour for %11.
  1367.  *                  These colors are supported only for 4 bit mode and higher.
  1368.  *  .XSpot,
  1369.  *  .YSpot        : Displacement of the mouse pointer's click pixel.
  1370.  *  .Width,
  1371.  *  .Height       : Width and Height of the SoftMouse.
  1372.  *  .Soft         : Pointer to SoftMouse structure, should always be initia-
  1373.  *                  lized for reasons of compatibility.
  1374.  *  .Hard         : Pointer to HardMouse structure; if you always want to use
  1375.  *                  the 'soft' mouse pointer this field should be NIL.
  1376.  *
  1377.  * Example: The standard mouse pointer.
  1378.  *
  1379.  *   StdMouse= EMouse:(Color1=$00000001,Color2=$FF0000FF,Color3=$80000080,
  1380.  *                     XSpot=1,YSpot=1,Width=25,Height=31,
  1381.  *                     Soft=SoftMouse:(
  1382.  *  (%01010101000000000000000000000000,%00000000000000000000000000000000),
  1383.  *  (%01111111010101010000000000000000,%00000000000000000000000000000000),
  1384.  *  (%01111010111111110101010100000000,%00000000000000000000000000000000),
  1385.  *  (%01111111101010101111111101010101,%00000000000000000000000000000000),
  1386.  *  (%00011111111110101010101011110100,%00000000000000000000000000000000),
  1387.  *  (%00011111111111111110101011010000,%00000000000000000000000000000000),
  1388.  *  (%00011111111111111111111101000000,%00000000000000000000000000000000),
  1389.  *  (%00011111111111111111110100000000,%00000000000000000000000000000000),
  1390.  *  (%00010111111111111111101101000000,%00000000000000000000000000000000),
  1391.  *  (%00000111111111111111111011010100,%00000000000000000000000000000000),
  1392.  *  (%00000111111111111111111110111101,%00000000000000000000000000000000),
  1393.  *  (%00000111111111011111111111101111,%01000000000000000000000000000000),
  1394.  *  (%00000101111101010111111111111011,%11010100000000000000000000000000),
  1395.  *  (%00000001110101010101111111111110,%10111101000000000000000000000000),
  1396.  *  (%00000001010101010101111111111111,%11101011010000000000000000000000),
  1397.  *  (%00000001010101010101011111111111,%11111010110101000000000000000000),
  1398.  *  (%00000001010101010101010111111111,%11111111101111010000000000000000),
  1399.  *  (%00000001010101010101010101111111,%11111111111101000000000000000000),
  1400.  *  (%00000001010101010101010101111111,%11111111010100000000000000000000),
  1401.  *  (%00000000010101010001010101011111,%11111101000000000000000000000000),
  1402.  *  (%00000000010101000000010101010111,%11110101010000000000000000000000),
  1403.  *  (%00000000010100000000010101010101,%11110101010100000000000000000000),
  1404.  *  (%00000000010000000000000101010101,%11010101010101010000000000000000),
  1405.  *  (%00000000000000000000000001010101,%01010101010101010100000000000000),
  1406.  *  (%00000000000000000000000000010101,%01010101010101010000000000000000),
  1407.  *  (%00000000000000000000000000010101,%01010101010101000000000000000000),
  1408.  *  (%00000000000000000000000000000101,%01010101010000000000000000000000),
  1409.  *  (%00000000000000000000000000000001,%01010101000000000000000000000000),
  1410.  *  (%00000000000000000000000000000000,%01010101000000000000000000000000),
  1411.  *  (%00000000000000000000000000000000,%01010100000000000000000000000000),
  1412.  *  (%00000000000000000000000000000000,%00010000000000000000000000000000),
  1413.  *  (%00000000000000000000000000000000,%00000000000000000000000000000000))'PTR);
  1414.  */
  1415.  
  1416. typedef struct  E_ClipRect *E_ClipRectPtr;
  1417.  
  1418. struct  E_ClipRect {
  1419.  
  1420.           E_ClipRectPtr     Next;
  1421.           WORD              Left,
  1422.                             Top,
  1423.                             Right,
  1424.                             Bottom;
  1425. };
  1426.  
  1427.  
  1428. struct E_EMouseImg {
  1429.             BYTE      width,height;
  1430.             BYTE   xSpot,ySpot;
  1431. };
  1432.  
  1433. typedef struct E_EMouseImg *E_EMouseImgPtr;
  1434.  
  1435. struct E_EMouseImg16 {
  1436.             struct E_EMouseImg     specs;
  1437.             ULONG                        image[16];
  1438. };
  1439.  
  1440. typedef struct E_EMouseImg16 *E_EMouseImg16Ptr;
  1441.  
  1442. struct E_EMouseImg32 {
  1443.          struct E_EMouseImg     specs;
  1444.             ULONG                        image[32][2];
  1445. };
  1446.  
  1447. typedef struct E_EMouseImg32 *E_EMouseImg32Ptr;
  1448.  
  1449. struct E_EMouseImg64 {
  1450.             struct E_EMouseImg     specs;
  1451.          ULONG                        image[64][4];
  1452. };
  1453.  
  1454. typedef struct E_EMouseImg64 *E_EMouseImg64Ptr;
  1455.  
  1456. /* EMouseFlags */
  1457.  
  1458. #define EMSF_DOUBLE16    1
  1459. #define    EMSF_DOUBLE32    2
  1460. #define    EMSF_HALF32    4
  1461. #define    EMSF_HALF64    8
  1462.  
  1463. /* EMouseVersion */
  1464.  
  1465. #define EMSV_00        0x00000000
  1466. #define    EMSV_01        0x10000000    /* shall be used */
  1467.  
  1468. typedef struct E_EMouse  *E_EMousePtr;
  1469.  
  1470. struct E_EMouse {
  1471.  
  1472.            LONG             Color1, Color2, Color3;
  1473.            ULONG                     Flags;
  1474.            ULONG                     Version;
  1475.            E_EMouseImg16Ptr    image16;
  1476.            E_EMouseImg32Ptr    image32;
  1477.            E_EMouseImg64Ptr    image64;
  1478. };
  1479.  
  1480.  
  1481. /*********************** EGS - Displaydatabase             *****************/
  1482. /*
  1483.  * These defines are for the EGS displaydatabase. This database contains the
  1484.  * sync and timing parameters for all graphic boards that support generic
  1485.  * timings.
  1486.  *
  1487.  * The main structure is the monitor. A monitor structure contains all
  1488.  * displaymodes that can be displayed on this monitor. Every screenmode
  1489.  * (here named as E_ScreenSpec) describes one resolution, and is composed
  1490.  * of one or more possible timing schemes (here called E_ScreenParam).
  1491.  *
  1492.  * These structures may olny be created and modified by library calls, as
  1493.  * they are cloned and distributed between several drivers.
  1494.  *
  1495.  * The information of this database is stored in "egs:monitors/specs". At
  1496.  * library initialisiation time, this information is retrieved.
  1497.  *
  1498.  * You should not change any of these structures, except for programs that
  1499.  * are intended to edit display parameters like the "EGS-DisplayAdjust".
  1500.  *
  1501.  */
  1502.  
  1503. #define E_COMPOSITE        0x00000001   /* The monitor requires a composite
  1504.                                          * sync signal. If missing, a separate
  1505.                                          * syncing signal will be generated.
  1506.                                          */
  1507. #define E_SYNC_ON_GREEN    0x00000002   /* The composite sync signal should
  1508.                                          * be mixed with the green color
  1509.                                          * signal. This flag is only valid
  1510.                                          * if E_COMPOSITE is also set.
  1511.                                          */
  1512. #define E_TESSELATED       0x00000004   /* A tesselated flyback pattern is to
  1513.                                          * be generated during vertical
  1514.                                          * flyback.
  1515.                                          */
  1516. #define E_BLANK            0x00000008   /* The blanking pedestal is not black
  1517.                                          * but even darker.
  1518.                                          */
  1519. /*
  1520.  * This structure describes one monitor type. Several monitor types maybe
  1521.  * mixed up for a single displaydriver.
  1522.  */
  1523.  
  1524. struct E_MonitorSpec {
  1525.  
  1526.         struct  Node  Node;     /* internal chaining, the list is found in
  1527.                                  * the hard info "monitors", the lh_name
  1528.                                  * field contains the monitor name
  1529.                                  */
  1530.         WORD          Pad0;
  1531.         struct  List  Screens;  /* list of the supported screenmodes; the
  1532.                                  * nodes are of type "E_ScreenSpec"
  1533.                                  */
  1534.         WORD          Pad1;
  1535.         ULONG         Sync;     /* Syncing flags                           */
  1536.  
  1537.         WORD          MinHoriz; /* minimum horizontal frequency * 1/100KHz */
  1538.         WORD          MaxHoriz; /* maximum horizontal frequency * 1/100KHz */
  1539.         WORD          MinVerti; /* minimum vertical frequency Â  * 1/100Hz  */
  1540.         WORD          MaxVerti; /* maximum vertical frequency   * 1/100Hz  */
  1541. };
  1542.  
  1543. typedef struct  E_MonitorSpec  *E_MonitorSpecPtr;
  1544.  
  1545. #define E_MST_SYNC        TAG_USER + 0
  1546. #define E_MST_MIN_HORIZ   TAG_USER + 1
  1547. #define E_MST_MAX_HORIZ   TAG_USER + 2
  1548. #define E_MST_MIN_VERTI   TAG_USER + 3
  1549. #define E_MST_MAX_VERTI   TAG_USER + 4
  1550.  
  1551. /*
  1552.  * Structure describing a single screen resolution.
  1553.  */
  1554.  
  1555. struct  E_ScreenSpec {
  1556.  
  1557.         struct   Node     Node;    /* internal chaining, the list is found
  1558.                                     * in the associated E_MonitorSpec
  1559.                                     * structure, the lh_name field contains
  1560.                                     * the basic name of the screenmode
  1561.                                     */
  1562.         WORD              Pad0;
  1563.         WORD              Width;   /* horizontal resolution in pixels      */
  1564.         WORD              Height;  /* vertical resolution in pixels        */
  1565.         struct   MinList  Params;  /* a list of possible sync timings,
  1566.                                     * consisting of "E_ScreenParam"
  1567.                                     */
  1568.         E_MonitorSpecPtr  Monitor; /* the associated monitor               */
  1569. };
  1570.  
  1571. typedef struct  E_ScreenSpec   *E_ScreenSpecPtr;
  1572.  
  1573. #define E_SSPT_NAME     TAG_USER + 0
  1574. #define E_SSPT_WIDTH    TAG_USER + 1
  1575. #define E_SSPT_HEIGHT   TAG_USER + 2
  1576.  
  1577. /*
  1578.  * Some notes about display and syncing...
  1579.  *
  1580.  *
  1581.  *
  1582.  *  +------------------------------------------------+
  1583.  *  |###################################     HH      |\
  1584.  *  |###################################     HH      | |
  1585.  *  |###################################     HH      | |
  1586.  *  |###################################     HH      | |
  1587.  *  |###################################     HH      | |
  1588.  *  |###################################     HH      | \ active vertical
  1589.  *  |###################################     HH      | /
  1590.  *  |###################################     HH      | |
  1591.  *  |###################################     HH      | |
  1592.  *  |###################################     HH      | |
  1593.  *  |###################################     HH      | |
  1594.  *  |###################################     HH      | |
  1595.  *  |###################################     HH      | |
  1596.  *  |###################################     HH      |/
  1597.  *  |                                        HH      |\_ vertical \
  1598.  *  |                                        HH      | | front     |
  1599.  *  |                                        HH      |/  porch     |
  1600.  *  |VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV|\_ vertical  | vertical
  1601.  *  |VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV|/  sync      \ blank
  1602.  *  |                                        HH      |\            /
  1603.  *  |                                        HH      | |           |
  1604.  *  |                                        HH      | | vertical  |
  1605.  *  |                                        HH      | \ back      |
  1606.  *  |                                        HH      | / porch     |
  1607.  *  |                                        HH      | |           |
  1608.  *  |                                        HH      |/           /
  1609.  *  +------------------------------------------------+
  1610.  *   \____________  ___________________/\  _/\/\_  _/
  1611.  *                \/                     \/  |   \/
  1612.  *            active horizontal          |   |  horizontal back porch
  1613.  *                                       |   |
  1614.  *                                       |   \ horizontal sync
  1615.  *                                       |
  1616.  *                                       \ horizontal front porch
  1617.  *
  1618.  *                                      \_  ________/
  1619.  *                                        \/
  1620.  *                                       horizontal blank
  1621.  *
  1622.  * Pixel timing diagramm:
  1623.  *
  1624.  *            .   .   .   .   .   .   .   .   .   .   .   .   .   .
  1625.  *            ._  ._  ._  ._  ._  ._  ._  ._  ._  ._  ._  ._  ._  ._
  1626.  * PClock  :  | | | | | | | | | | | | | | | | | | | | | | | | | | |
  1627.  *           _|.|_|.|_|.|_|.|_|.|_|.|_|.|_|.|_|.|_|.|_|.|_|.|_|.|_|.
  1628.  *            .   .   .   .   .   .   .   .__________     .   .   .
  1629.  * RGB     :  .   .   .   .   .   .   .___/   .   .  \    .   .   .
  1630.  *            .   .   .   .   .   .___/   .   .   .   |   .   ._____
  1631.  *            .   .   .___.   .   /   .   .   .   .   |   .   /   .
  1632.  *            .   .___/   \   .   |   .   .   .   .   |   .   |   .
  1633.  *     black ...../........\_____/.....................\_____/......
  1634.  *            .   |   .   .   .   .   .   .   .   .   .   .   .   .
  1635.  *     blank ____/.   .   .   .   .   .   .   .   .   .   .   .   .
  1636.  *            .   ._________________________________________________
  1637.  * DispEn  :  .   |   .   .   .   .   .   .   .   .   .   .   .   .
  1638.  *           _____|.................................................
  1639.  *            .   .   .   .   .   .   .   .   .   .   .   .   .   .
  1640.  *
  1641.  * PClock or pixel frequency determines the speed at which pixels are sampled
  1642.  * and sent to the DACs.
  1643.  *
  1644.  *
  1645.  *
  1646.  *
  1647.  * Horizontal timinig diagram:
  1648.  *
  1649.  *                .                              .    . .     .
  1650.  * RGB     :      ##############   ##############.    . .     ######
  1651.  *           _____##############...##############_____________######
  1652.  *                .______________________________.    . .     ._____
  1653.  * DispEn:        |                              |    . .     |
  1654.  *           _____|..............................|____________|.....
  1655.  *                .                              .    ._.     .
  1656.  * HSync   :      .                              .    | |     .
  1657.  *           _________________________________________|.|___________
  1658.  *                .                              .    . .     .
  1659.  * Sync on :      ##############   ##############.    . .     ######
  1660.  * green     _____##############...##############_____..._____######
  1661.  *                .                              .    |_|     .
  1662.  *                .                              .    . .     .
  1663.  *
  1664.  *                | - active video ------------- | hf | | hb  |
  1665.  *                |                              |    hs      |
  1666.  *                |                              |            |
  1667.  *                |                              | - hblank - |
  1668.  *                |                                           |
  1669.  *                | - linetime ------------------------------ |
  1670.  *
  1671.  *   hf      : Horizontal front porch, the time between the end of the
  1672.  *             active display to the start of the horizontal sync pulse.
  1673.  *             This value controls the size of the right border of a display.
  1674.  *
  1675.  *   hs      : Horizontal sync, this signal starts the horizontal flyback.
  1676.  *
  1677.  *   hb      : Horizontal back porch, the time between the and of the
  1678.  *             horizontal sync pulse to the start of the next display line.
  1679.  *             This value contorls the size of the left border of a display.
  1680.  *
  1681.  *   hblank  : The full blanking period, from the end of line n to the start
  1682.  *             of line n+1. This value controlls the width of the display.
  1683.  *             If hf and hb are changed, but hblank kept the same, the display
  1684.  *             can be moved to the left or right.
  1685.  *
  1686.  *   hfreq   : The horizontal line frequency equals 1/linetime
  1687.  *
  1688.  * Vertical timing diagramm:
  1689.  *
  1690.  *               .     .     .     .     .     .     .     .     .
  1691.  * RGB     : ####. ####. ####.     .     .     .     .     .     . #
  1692.  *           ####._####__####______________________________________#
  1693.  *           ___ . ___ . ___ . ___ .     .     .     .     .     . _
  1694.  * DispEn  :    |.|   |.|   |.|   |.     .     .     .     .     .|
  1695.  *           ...|_|...|_|...|_|...|_______________________________|.
  1696.  *               .     .     .     .     .     .     .     .     .
  1697.  * HSync   :     |     |     |     |  |  |  |  |  |  |     |     |
  1698.  *           ____|_____|_____|_____|__|__|__|__|__|__|_____|_____|__
  1699.  *               .     .     .     .     ._____.     .     .     .
  1700.  * VSync   :     .     .     .     .     |     |     .     .     .
  1701.  *           ____________________________|.....|____________________
  1702.  *               .     .     .     .     ._____.     .     .     .
  1703.  * CSync   :     |     |     |     |     |     |     .     .     |
  1704.  *           ____|_____|_____|_____|_____|.....|_________________|__
  1705.  *               .     .     .     .     .__ __.     .     .     .
  1706.  * CSync   :     |     |     |     |  |  |  |  |  |  |     |     |
  1707.  * tesselated____|_____|_____|_____|__|__|..|..|__|__|_____|_____|__
  1708.  *               .     .     .     .     .     .     .     .     .
  1709.  * CSync on: ####. ####. ####.     .     .     .     .     .     . #
  1710.  * green     ####._####._####._____.__ __.......__ __._____._____._#
  1711.  *               |     |     |     |  |  |__|__|  |  |     |     |
  1712.  *               .     .     .     .     .     .     .     .     .
  1713.  *
  1714.  *                          |      |vpre |    |vpost|             |
  1715.  *                          |                                     |
  1716.  *                          | --- vf --- | vs | ----- vb -------- |
  1717.  *                          |                                     |
  1718.  *           <-- active --- | - vertical blanking period vblank - |->
  1719.  *                          |
  1720.  *           <------------- | - frametime -------------------------->
  1721.  *
  1722.  *   vf      : Vertical front porch, the time from the end of the last
  1723.  *             active line to the start of the sync signal, controls the
  1724.  *             the size of the bottom border of the display
  1725.  *
  1726.  *   vs      : Vertical sync pulse, start the vertical flyback
  1727.  *
  1728.  *   vb      : Vertical back porch, the time from the end of the vertical
  1729.  *             sync to the start of the next display frame. This value
  1730.  *             controls the size of the top border
  1731.  *
  1732.  *   vpre,
  1733.  *   vpost   : Vertical ??serration?? pulses, needed in interlace mode to
  1734.  *             sync on a half line
  1735.  *
  1736.  *   vblank  : The full vertical blanking period this value controls
  1737.  *             the vertical size of the display
  1738.  *
  1739.  *   vfreq   : The vertical frame frequency equals 1/frametime
  1740.  *
  1741.  *
  1742.  */
  1743.  
  1744. #define E_LACED      0x00000001    /* The screen will be interlaced        */
  1745. #define E_DOUBLED    0x00000002    /* The screen will be doublescanned     */
  1746.  
  1747. struct E_ScreenParam {
  1748.  
  1749.        struct  MinNode MinNode;   /* internal chaining, the list is found
  1750.                                    * in the associated screen param struct.
  1751.                                    */
  1752.        WORD            PixFreq;   /* pixel frequency in units of 1/100 MHz */
  1753.        WORD            LineFreq;  /* line  frequency in units of 1/100 KHz */
  1754.        WORD            FrameFreq; /* frame frequency in units of 1/100  Hz */
  1755.        WORD            Pad0;
  1756.  
  1757.        ULONG           Flags;     /* ScreenParamFlagSet                    */
  1758.  
  1759.        WORD            Hfront;    /* horizontal front porch in ns          */
  1760.        WORD            Hsync;     /* horizontal sync in ns                 */
  1761.        WORD            Hback;     /* horizontal back porch in ns           */
  1762.  
  1763.        WORD            Vfront;    /* vertical front porch in Âµs            */
  1764.        WORD            Vsync;     /* vertical sync in Âµs                   */
  1765.        WORD            Vback;     /* vertical back porch in Âµs             */
  1766.        WORD            Vpre;      /* vertical preequalisation in Âµs        */
  1767.        WORD            Vpost;     /* vertical postequalisation in Âµs       */
  1768.  
  1769.        E_ScreenSpecPtr Screen;    /* the ruling screen param               */
  1770. };
  1771.  
  1772. typedef struct  E_ScreenParam  *E_ScreenParamPtr;
  1773.  
  1774. #define E_SPT_PIXFREQ   TAG_USER + 0
  1775. #define E_SPT_LINEFREQ  TAG_USER + 1
  1776. #define E_SPT_FRAMEFREQ TAG_USER + 2
  1777. #define E_SPT_FLAGS     TAG_USER + 3
  1778. #define E_SPT_HFRONT    TAG_USER + 4
  1779. #define E_SPT_HSYNC     TAG_USER + 5
  1780. #define E_SPT_HBACK     TAG_USER + 6
  1781. #define E_SPT_VFRONT    TAG_USER + 7
  1782. #define E_SPT_VSYNC     TAG_USER + 8
  1783. #define E_SPT_VBACK     TAG_USER + 9
  1784. #define E_SPT_VPRE      TAG_USER + 10
  1785. #define E_SPT_VPOST     TAG_USER + 11
  1786.  
  1787.  
  1788.  
  1789. /*********************** EGS - Video    **************************************/
  1790. /*
  1791.  * As EGS supports several graphics boards, digitizer and other familiar hardware
  1792.  * at the same time, there has to be a structure that describes the logical
  1793.  * routing of video signals.
  1794.  *
  1795.  * EGS supports a ??bipartite?? graph of E_VideoNodes and E_VideoLinks, that
  1796.  * represent the logical video routing.
  1797.  *
  1798.  * The routing information can be changed and retrieved by EGS message
  1799.  * dispatching, or direct library calls.
  1800.  *
  1801.  *
  1802.  *
  1803.  *
  1804.  */
  1805.  
  1806. /*  VideoNodeFlags  */
  1807.  
  1808. #define E_CONTINUOS  0x00000001  /* The device does continues work   */
  1809. #define E_ACTIVE     0x00000002  /* The device only works on request */
  1810.  
  1811. /*
  1812.  * Basic structure of all video nodes.
  1813.  */
  1814.  
  1815. struct E_VideoNode {
  1816.  
  1817.       /* E_EGSObject          Object; */  /* is an EGS object              */
  1818.          struct Node          Node;       /* linking of public video nodes */
  1819.          WORD                 Pad0;
  1820.          ULONG                Flags;      /* VideoNodeFlags                */
  1821.          APTR                 DriverData; /* driver specific private data  */
  1822. };
  1823.  
  1824. typedef struct E_VideoNode *E_VideoNodePtr;
  1825.  
  1826. /*
  1827.  * An videolink links to video nodes together.
  1828.  */
  1829.  
  1830. struct E_VideoLink {
  1831.  
  1832.          struct MinNode    Node;          /* private linking               */
  1833.          E_VideoNodePtr    From;          /* the signal source             */
  1834.          E_VideoNodePtr    To;            /* the signal drain              */
  1835.          APTR              FromData;      /* private source data           */
  1836.          APTR              ToData;        /* private drain data            */
  1837. };
  1838.  
  1839. typedef struct E_VideoLink *E_VideoLinkPtr;
  1840.  
  1841. /*
  1842.  * Basic node of all video emitting devices
  1843.  */
  1844.  
  1845. struct E_VideoSource {
  1846.  
  1847.          struct E_VideoNode VideoNode;    /* Supertypedata                 */
  1848.          E_VideoLinkPtr     Out;          /* output link                   */
  1849. };
  1850.  
  1851. typedef struct E_VideoSource *VideoSourcePtr;
  1852.  
  1853. /*
  1854.  * Basic node of all video receiving devices
  1855.  */
  1856.  
  1857. struct E_VideoDrain {
  1858.  
  1859.          struct E_VideoNode VideoNode;    /* Supertypedata                 */
  1860.          E_VideoLinkPtr     In;           /* input link                    */
  1861. };
  1862.  
  1863. typedef struct  E_VideoDrain *E_VideoDrainPtr;
  1864.  
  1865. /*
  1866.  * Video multiplexer node, several inputs, one output. One of the input
  1867.  * signals is routed to the output. This type can be used for multiscreen
  1868.  * display drivers or switchboxes.
  1869.  */
  1870.  
  1871. struct E_VideoMux {
  1872.  
  1873.          struct E_VideoSource VideioSource; /* Supertypedata               */
  1874.          struct List          In;           /* list of incoming links,
  1875.                                              * consists of E_VideoMuxChannel
  1876.                                              */
  1877.          WORD                 Pad0;
  1878.          E_VideoLinkPtr       CurrentIn;    /* the current input signal    */
  1879. };
  1880.  
  1881. typedef struct E_VideoMux *E_VideoMuxPtr;
  1882.  
  1883. struct E_VideoMuxChannel {
  1884.  
  1885.         struct Node      Node;              /* internal chaining           */
  1886.         WORD    Pad0;
  1887.         E_VideoLinkPtr   Link;              /* the represented link        */
  1888. };
  1889.  
  1890. typedef struct  E_VideoMuxChannel *E_VideoMuxChannelPtr;
  1891.  
  1892. /*
  1893.  * A video multiplier, spreads one signal over several drains.
  1894.  */
  1895.  
  1896. struct E_VideoMulti {
  1897.  
  1898.         struct E_VideoDrain  VideoDrain;    /* Supertypedata               */
  1899.         struct List          Out;           /* list of outputs             */
  1900.         WORD                 Pad0;
  1901. };
  1902.  
  1903.  
  1904. typedef struct E_VideoMulti *E_VideoMultiPtr;
  1905.  
  1906. /*
  1907.  * Message for linking purposes between video nodes.
  1908.  */
  1909.  
  1910. struct E_LinkMsg {
  1911.  
  1912.          struct E_EGSObjMsg  ObjMsg;      /* Messageheader                 */
  1913.          E_VideoLinkPtr      Link;        /* link to be linked or removed  */
  1914.          E_VideoNodePtr      From;        /* node that serves as source    */
  1915.          E_VideoNodePtr      To;          /* node that seves as drain      */
  1916. };
  1917.  
  1918. typedef  struct E_LinkMsg *E_LinkMsgPtr;
  1919.  
  1920. /*
  1921.  * Message for activation purposes
  1922.  */
  1923.  
  1924. struct E_ActivateMsg {
  1925.  
  1926.          struct E_EGSObjMsg  ObjMsg;
  1927. };
  1928.  
  1929. typedef struct E_ActivateMsg *E_ActivateMsgPtr;
  1930.  
  1931. /*
  1932.  * Message to establish a connections between a video source
  1933.  * to a video drain.
  1934.  */
  1935.  
  1936. struct E_RouteMsg {
  1937.  
  1938.          struct E_EGSObjMsg  ObjMsg;      /* Messageheader                 */
  1939.          E_VideoLinkPtr      Link;        /* inputlink, to be routed to the
  1940.                                            * nodes output
  1941.                                            */
  1942. };
  1943.  
  1944. typedef struct E_RouteMsg *E_RouteMsgPtr;
  1945.  
  1946. /*
  1947.  * Message to retrieve informations of the current video routing.
  1948.  */
  1949.  
  1950. struct E_GetRouteMsg {
  1951.  
  1952.          struct E_EGSObjMsg  ObjMsg;      /* Messageheader                 */
  1953.          E_VideoNodePtr      Start;       /* starting node                 */
  1954.          E_VideoNodePtr      End;         /* ending node                   */
  1955.          E_VideoLinkPtr      Link;        /* currently used link           */
  1956.          UBYTE               Ok;          /* boolean result                */
  1957.          UBYTE               Pad0;
  1958.          WORD                Pad1;
  1959.  
  1960. };
  1961.  
  1962. typedef struct E_GetRouteMsg *E_GetRouteMsgPtr;
  1963.  
  1964. /*
  1965.  * Activate a given video node, and try to display it. This is used for
  1966.  * screen to front or the like.
  1967.  */
  1968. #define  E_ActivateName           "activate"
  1969.  
  1970. /*
  1971.  * Deactivate a given video node, and try to hide it from the display;
  1972.  */
  1973. #define  E_DeactivateName         "deactivate"
  1974.  
  1975. /*
  1976.  * Add a source link to a video node
  1977.  */
  1978. #define  E_AddFromLinkName        "addFromLink"
  1979.  
  1980. /*
  1981.  * Remove a source link from a video node
  1982.  */
  1983. #define  E_RemFromLinkName        "remFromLink"
  1984.  
  1985. /*
  1986.  * Add a drain link to a video node
  1987.  */
  1988. #define  E_AddToLinkName          "addToLink"
  1989.  
  1990. /*
  1991.  * Remove a drain link from a video node
  1992.  */
  1993. #define  E_RemToLinkName          "remToLink"
  1994.  
  1995. /*
  1996.  * Route a video input to the nodes output and propagate to the next node.
  1997.  */
  1998. #define  E_RouteName              "route"
  1999.  
  2000. /*
  2001.  * Find a current video drain to a given video node
  2002.  */
  2003. #define  E_FindDrainName          "findDrain"
  2004.  
  2005. /*
  2006.  * Find a current video source to a given video node
  2007.  */
  2008. #define  E_FindSourceName         "findSource"
  2009.  
  2010. /*
  2011.  * Check, if a given video node is a drain of an other one
  2012.  */
  2013. #define  E_CheckDrainName         "checkDrain"
  2014.  
  2015. /*
  2016.  * Check, if a given video node is a source of another node
  2017.  */
  2018. #define  E_CheckSourceName        "checkSource"
  2019.  
  2020. /*
  2021.  * Test if a video node can be routed to be the drain of an other node
  2022.  */
  2023. #define  E_AvailDrainName         "availDrain"
  2024.  
  2025. /*
  2026.  * Test if a video node can be routed to be the source of an other node
  2027.  */
  2028. #define  E_AvailSourceName        "availSource"
  2029.  
  2030. /*
  2031.  * Classnames for basic video node classes
  2032.  */
  2033. #define  E_VideoNodeClassName     "VideoNode.class"
  2034. #define  E_VideoSourceClassName   "VideoSource.class"
  2035. #define  E_VideoDrainClassName    "VideoDrain.class"
  2036. #define  E_VideoMuxClassName      "VideoMux.class"
  2037. #define  E_VideoMultiClassName    "VideoMulti.class"
  2038.  
  2039. /*********************** EGS - Screen    ************************************/
  2040. /*
  2041.  * E_EScreens are a combination of a bitmap, a video node and an input system.
  2042.  * They emulate a virtual graphic terminal, and serve as the base of most
  2043.  * EGS work.
  2044.  *
  2045.  * An E_EScreen is still a low level element, so it would be wis, to use the
  2046.  * windows and other GUI elements, supported by EGSintui...
  2047.  *
  2048.  * E_EScreens may be useful for video applications, games and emulations.
  2049.  *
  2050.  * Every E_EScreen is accompanied by an E_Map2Video video node. This node is
  2051.  * created by a displaydriver.
  2052.  *
  2053.  *
  2054.  */
  2055.  
  2056. /*
  2057.  * This is the class container of map2video video node objects. It is
  2058.  * extended with some shortcuts, to speed up mouse and color activities.
  2059.  *
  2060.  * Every map2video class must inherit this class.
  2061.  *
  2062.  */
  2063.  
  2064. struct   E_Map2VideoClass {
  2065.  
  2066.            struct E_EGSClass   Class;       /* superclassdata              */
  2067.            struct E_EGSMethod               /* dispatcher shortcuts        */
  2068.                                MouseOn,
  2069.                                MouseOff,
  2070.                                SetMouse,
  2071.                                HideMouse,
  2072.                                DefineMouse,
  2073.                                SetRGB8,
  2074.                                WaitTOF,
  2075.                                FlipMap;
  2076. };
  2077.  
  2078. typedef struct E_Map2VideoClass *E_Map2VideoClassPtr;
  2079.  
  2080. /*
  2081.  * The map2video node base object. It may be extended by custom display
  2082.  * drivers by the use of subclassing. All display specific information
  2083.  * of the screen is stored here (esp. in the ViewData field).
  2084.  */
  2085.  
  2086. struct E_Map2Video {
  2087.  
  2088.          struct E_VideoSource   VideoSource;  /* superclassdata            */
  2089.          E_EScreenPtr           Scr;          /* the associated E_EScreen  */
  2090.          APTR                   ViewData;     /* driver private display
  2091.                                                * data
  2092.                                                */
  2093.          E_Map2VideoClassPtr    Class;        /* easy access to the class  */
  2094. };
  2095.  
  2096. typedef  struct E_Map2Video *E_Map2VideoPtr;
  2097.  
  2098. /*
  2099.  * Messages for mouse related operations.
  2100.  */
  2101.  
  2102. struct  E_MouseMsg {
  2103.  
  2104.           struct E_EGSObjMsg       ObjMsg;    /* Message header            */
  2105.           WORD                     X,Y;       /* Mouse location            */
  2106.           E_EMousePtr              Mouse;     /* Mouseimage and colors     */
  2107. };
  2108.  
  2109. typedef struct  E_MouseMsg *E_MouseMsgPtr;
  2110.  
  2111. /*
  2112.  * Messages for color operations.
  2113.  */
  2114.  
  2115. struct E_SetRGB8Msg {
  2116.  
  2117.          struct E_EGSObjMsg       ObjMsg;     /* Message header            */
  2118.          WORD                     From;       /* first color that has been
  2119.                                                * changed
  2120.                                                */
  2121.          WORD                     Num;        /* number of colors that have
  2122.                                                * been changed
  2123.                                                */
  2124. };
  2125.  
  2126. typedef struct E_SetRGB8Msg *E_SetRGB8MsgPtr;
  2127.  
  2128. /*
  2129.  * Message for E_WaitTOF
  2130.  */
  2131.  
  2132. struct E_WaitTOFMsg {
  2133.  
  2134.          struct E_EGSObjMsg       ObjMsg;     /* Message header            */
  2135. };
  2136.  
  2137. typedef struct  E_WaitTOFMsg *E_WaitTOFMsgPtr;
  2138.  
  2139. /*
  2140.  * Message for bitmap flipping
  2141.  */
  2142.  
  2143. struct E_FlipMapMsg {
  2144.  
  2145.          struct E_EGSObjMsg       ObjMsg;     /* Message header            */
  2146.          E_EBitMapPtr             NewMap;     /* the new map to be
  2147.                                                * displayed
  2148.                                                */
  2149.          E_EBitMapPtr             OldMap;     /* resulting the old map that
  2150.                                                * was previously
  2151.                                                * displayed
  2152.                                                */
  2153. };
  2154.  
  2155. typedef  struct E_FlipMapMsg *E_FlipMapMsgPtr;
  2156.  
  2157. /*
  2158.  * Message sent for recalculation of a displaymode, to reflect changes.
  2159.  */
  2160.  
  2161. struct E_RecalcViewMsg {
  2162.  
  2163.          struct E_EGSObjMsg       ObjMsg;     /* Message header            */
  2164.          E_ScreenParamPtr         mode;       /* The mode that has been
  2165.                                                * changed
  2166.                                                */
  2167. };
  2168.  
  2169. typedef struct E_RecalcViewMsg *RecalcViewMsgPtr;
  2170.  
  2171. /*
  2172.  * Please note that an EScreen is different from the EGSIntui screens, i.e.
  2173.  * NO window can be opened on any EScreen; for that purpose an EGSIntui screen
  2174.  * must be created.
  2175.  */
  2176.  
  2177. /* Corresponding EScrFlagSet has 32 bits ! */
  2178.  
  2179. #define E_SCREENBEHIND     0x00000001  /* The screen shall be opened behind
  2180.                                         * all others
  2181.                                         */
  2182. #define E_OWN_BITMAP       0x00000002  /* The screen is using a custom
  2183.                                         * bitmap. (DISABLED at this time)
  2184.                                         */
  2185. #define E_LACESCREEN       0x00000004
  2186. #define E_SF3              0x00000008
  2187. #define E_SF4              0x00000010
  2188. #define E_SF5              0x00000020
  2189. #define E_HARDMOUSE        0x00000040  /* The screen has a hardware mouse
  2190.                                         * cursor. You may check this to
  2191.                                         * avoid (E_MouseOn/Off) calls
  2192.                                         */
  2193. #define E_OWN_INPUTSERVER  0x00000080  /* The displaydriver implements an
  2194.                                         * own inputserver for this screen
  2195.                                         */
  2196. #define E_FAKE_INTUISERVER 0x00000100  /* This is no real screen, it is
  2197.                                         * only a hack to represent an
  2198.                                         * intuition screen
  2199.                                         */
  2200. #define E_DITHER_COLORS    0x00000200  /* The palette will be initialized
  2201.                                         * for automatic dithering
  2202.                                         */
  2203. #define E_MOUSEOFF         0x00000400  /* The mouse is currently switched
  2204.                                         * off
  2205.                                                        */
  2206. #define E_DEFAULT_SCREEN   0x00000800  /* This is the EGSIntui default
  2207.                                         * screen
  2208.                                                        */
  2209. #define E_SF12                   0x00001000
  2210. #define E_HIDEMOUSE           0x00002000  /* Do not show the mouse on this
  2211.                                         * screen
  2212.                                                              */
  2213. #define E_MONOCHROME          0x00004000  /* The screen shall open monochrome
  2214.                                         * (greyscale) if possible
  2215.                                         */
  2216.  
  2217. /*
  2218.  * Requesting structure for E_OpenScreen
  2219.  */
  2220.  
  2221. struct E_NewEScreen {
  2222.           char            *Mode;       /* Name of the requested display
  2223.                                         * mode. The available mode names
  2224.                                         * can be retrieved by use of the
  2225.                                         * hardinfo structure.
  2226.                                         */
  2227.           UWORD            Depth;      /* requested depth                */
  2228.           UWORD            Pad_1;
  2229.           E_CLUPtr         Colors;     /* initializing colorpalette or
  2230.                                         * NULL for standard palette
  2231.                                         */
  2232.           E_EBitMapPtr     Map;        /* Custom map (DISABLED use NULL) */
  2233.           ULONG            Flags;      /* requesting flags for the new
  2234.                                         * screen; available at this point
  2235.                                         * are E_SCREENBEHIND and
  2236.                                         * E_DITHERCOLORS
  2237.                                         */
  2238.           E_EMousePtr      Mouse;      /* an initial mousepointer for the
  2239.                                         * screen
  2240.                                         */
  2241.           ULONG            EdcmpFlags; /* initial edcmpflags for the new
  2242.                                         * screen
  2243.                                         */
  2244.           struct MsgPort  *Port;       /* a custom port, has to be removed
  2245.                                         * before the screen is closed
  2246.                                         */
  2247. };
  2248.  
  2249. typedef struct E_NewEScreen *E_NewEScreenPtr;
  2250.  
  2251. /*   EScreenTags   */
  2252.  
  2253. #define   EST_MODE       0x80100000
  2254. #define   EST_DEPTH      EST_MODE+1
  2255. #define   EST_COLORS     EST_MODE+2
  2256. #define   EST_MAP        EST_MODE+3
  2257. #define   EST_FLAGS      EST_MODE+4
  2258. #define   EST_MOUSE      EST_MODE+5
  2259. #define   EST_EDCMPFLAGS EST_MODE+6
  2260. #define   EST_PORT       EST_MODE+7
  2261.  
  2262. #define   EST_WIDTH      EST_MODE+8    /* requested width for the screens
  2263.                                         * bitmap; If the driver can not
  2264.                                         * fullfill your wish, you will
  2265.                                         * get the maximum that is
  2266.                                         * possible
  2267.                                         */
  2268. #define   EST_HEIGHT     EST_MODE+9    /* requested height, same restrictions
  2269.                                         * as EST_WIDTH
  2270.                                         */
  2271. /*
  2272.  * EScreen
  2273.  *  .Prev,
  2274.  *  .Next          : Internal chaining.
  2275.  *  .View          : !!!! PRIVATE !!!!
  2276.  *  .Map           : Pointer to the screen's BitMap structure.
  2277.  *  .Colors        : !!!! PRIVATE !!!!
  2278.  *  .Mouse         : EMouse structure (READ ONLY !!!!).
  2279.  *  .MouseOn       : !!!! PRIVATE !!!!
  2280.  *  .EdcmpFlags    : Message flags (READ ONLY !!!).
  2281.  *  .Port          : Screen's message port.
  2282.  *  .BackLink      : Link field for users, e.g. used by EGSIntui.
  2283.  *  .MouseX,
  2284.  *  .MouseY        : Always the current mouse position on the screen.
  2285.  */
  2286.  
  2287.  
  2288. struct E_EScreen {
  2289.  
  2290.          struct MinNode     Node;           /* internal chaining         */
  2291.          E_Map2VideoPtr     View;           /* the screens view          */
  2292.          E_EBitMapPtr       Map;            /* the screens bitmap        */
  2293.          E_CLUPtr           Colors;         /* the screens colormap      */
  2294.          E_EMousePtr        Mouse;          /* the screens mouse image   */
  2295.          ULONG              Flags;          /* the screens flags         */
  2296.          UBYTE              MouseOn;
  2297.          UBYTE              Pad_1;
  2298.          UBYTE              Pad_2;
  2299.          UBYTE              Pad_3;
  2300.          ULONG              E_edcmpFlags;   /* current edcmpflags        */
  2301.          struct MsgPort    *Port;           /* current message port      */
  2302.          APTR               BackLink;       /* user specific             */
  2303.          WORD               MouseX, MouseY; /* current mouse location    */
  2304.          APTR               EIScreen;
  2305.             struct E_ClipRect  Off;
  2306.             char                    *ModeName;
  2307.             struct E_EMouseImg MouseImg;
  2308. };
  2309.  
  2310. /*
  2311.  * List that contains all monitor specs that are supported by a monitor
  2312.  * that is linked to a display driver
  2313.  */
  2314.  
  2315. struct E_MonitorUse {
  2316.  
  2317.          struct MinNode    Node;
  2318.          E_MonitorSpecPtr  Monitor;
  2319. };
  2320.  
  2321. typedef  struct E_MonitorUse *E_MonitorUsePtr;
  2322.  
  2323.  
  2324. #define  E_SUPPORTS_GENERICSYNCS  0x00000001 /* the driver supports generic
  2325.                                               * sync timing
  2326.                                               */
  2327. #define  E_SUPPORTS_INTERLACE     0x00000002 /* the driver supports inter-
  2328.                                               * laced graphic modes
  2329.                                               */
  2330. #define  E_SUPPORTS_DOUBLESCAN    0x00000004 /* the driver supports double
  2331.                                               * scanned graphic modes
  2332.                                               */
  2333.  
  2334. struct  E_MinMax {
  2335.  
  2336.         WORD    min;
  2337.         WORD    max;
  2338. };
  2339.  
  2340. /*
  2341.  * Basic object structure of a display driver. A display driver offers
  2342.  * the system one or more screenmodes. It is able to create a map2video
  2343.  * video node that then controlls the open screen.
  2344.  */
  2345.  
  2346. struct E_DisplayDriver {
  2347.  
  2348.       /* E_EGSObject         Object; */
  2349.                                         /* it's an object !!!          */
  2350.          struct  Node        Node;      /* internal chaining, the list
  2351.                                          * is found in the hardinfo
  2352.                                          * structure
  2353.                                          */
  2354.          WORD                Pad0;
  2355.  
  2356.          char               *Prefix;    /* the prefix name of all the
  2357.                                          * drivers screenmodes like
  2358.                                          * "LEGSa:" or "RB3a:"
  2359.                                          */
  2360.          ULONG               Depths;    /* supported colordepths, each
  2361.                                          * bit represents one depth, so
  2362.                                          * 1<<8 stands for eight biz
  2363.                                          */
  2364.          struct  E_MinMax    Freqs[24]; /* supported pixel frequency
  2365.                                          * intervalls for specific color
  2366.                                          * depths. (as C does not support
  2367.                                          * array starting at one, the
  2368.                                          * index is colordepth minus one)
  2369.                                          */
  2370.          struct MinList      Monitors;  /* supported specs of the attached
  2371.                                          * monitor
  2372.                                          */
  2373.          ULONG               Flags;     /* DisplayDriverFlagSet; */
  2374.          char               *Default;   /* the name of the drivers defaults
  2375.                                          * file
  2376.                                                         */
  2377.             ULONG                MaxPixel[24];   /* The maxmimum number of pixels
  2378.                                          * the graphics device can
  2379.                                          * in a given color depth. (As C
  2380.                                          * does not support arrays
  2381.                                          * starting at one, the index is
  2382.                                          * colordepth minus one)
  2383.                                          */
  2384.          ULONG               MemSize;   /* The size of the onboard memory in
  2385.                                          * bytes
  2386.                                          */
  2387.          UWORD              MouseSize;  /* The maximum mouse size, may be
  2388.                                                         * less for some screenmodes
  2389.                                                         */
  2390.             UWORD                    Pad1;
  2391.             char                    *description; /* A small text describing the
  2392.                                                          * graphics device
  2393.                                                          */
  2394. };
  2395.  
  2396. typedef struct E_DisplayDriver *E_DisplayDriverPtr;
  2397.  
  2398. /*
  2399.  * Message for creation of a displaydriver
  2400.  */
  2401.  
  2402. struct E_CreateDisplayDriverMsg {
  2403.  
  2404.          struct E_CreateMsg  CreateMsg; /* Message heaer                   */
  2405.          char               *Name;      /* the driver name                 */
  2406.          char               *Prefix;    /* the used prefix                 */
  2407. };
  2408.  
  2409. typedef struct E_CreateDisplayDriverMsg *E_CreateDisplayDriverMsgPtr;
  2410.  
  2411.  
  2412. /*
  2413.  * Information on supported screen modes and depths. The list including
  2414.  * these modes is found by 'GetHardInfo'.
  2415.  *
  2416.  */
  2417.  
  2418.  
  2419. struct E_ScreenMode {
  2420.  
  2421.          struct   Node      Node;      /* internal chaining, the lh_Name
  2422.                                         * field contains the modes name
  2423.                                         */
  2424.          UWORD              Pad;
  2425.          UWORD              Horiz;     /* horizontal resolution            */
  2426.          UWORD              Vert;      /* vertical resolution              */
  2427.          ULONG              Depths;    /* supported depths                 */
  2428.          E_DisplayDriverPtr Driver;    /* offering driver                  */
  2429.             E_ScreenParamPtr   Specs[24]; /* used spec  0 for 1 bit...        */
  2430. };
  2431.  
  2432. typedef struct E_ScreenMode *E_ScreenModePtr;
  2433.  
  2434.  
  2435. /*
  2436.  * Message for calculation of the real timings that will be generated
  2437.  * by a display hardware for a requested mode
  2438.  */
  2439.  
  2440. struct  E_GetRealTimingsMsg {
  2441.  
  2442.          struct E_EGSObjMsg  ObjMsg;   /* Message header                   */
  2443.          E_ScreenParamPtr    Param;    /* the requested timings            */
  2444.          E_ScreenParamPtr    Real;     /* the resulting timings            */
  2445. };
  2446.  
  2447.  
  2448. typedef struct E_GetRealTimingsMsg *E_GetRealTimingsMsgPtr;
  2449.  
  2450. /*
  2451.  * Message sent to a display driver to create a map2video node for a new
  2452.  * E_EScreen. The driver is also responsible to create and including a
  2453.  * matching bitmap.
  2454.  */
  2455.  
  2456. /*
  2457. typedef struct TagItem  **E_ScreenTagListPtr;
  2458. */
  2459. typedef APTR E_EScreenTagListPtr;
  2460.  
  2461. struct E_OpenMap2VideoMsg {
  2462.  
  2463.          struct E_EGSObjMsg  ObjMsg;      /* Message header                */
  2464.          E_NewEScreenPtr     Newe;        /* the E_NewEScreen structure    */
  2465.          E_EScreenPtr        Escr;        /* the partially initialized
  2466.                                            * E_EScreen structure
  2467.                                            */
  2468.          E_ScreenModePtr     ScreenMode;  /* the requested screen mode     */
  2469.          E_Map2VideoPtr      M2V;         /* the resulting map2video node  */
  2470.          E_EScreenTagListPtr Tags;        /* additional tags               */
  2471. };
  2472.  
  2473. typedef  struct E_OpenMap2VideoMsg *E_OpenMap2VideoMsgPtr;
  2474.  
  2475. struct E_Blanker {
  2476.             /* E_EGSObject */
  2477.             struct MinNode         Node;
  2478.             E_EScreenPtr         Screen;
  2479. };
  2480.  
  2481. struct E_CreateBlankerMsg {
  2482.             struct E_EGSObjMsg     ObjMsg;       /* Message header  */
  2483.             E_EScreenPtr           OldScreen;       /* The currently displayed
  2484.                                                * screen
  2485.                                                */
  2486. };
  2487.  
  2488. /*
  2489.  * Set the current input focus to a screen
  2490.  */
  2491. #define  E_SetUserFocusName       "setUserFocus"
  2492.  
  2493. /*
  2494.  * Turn mouse on/off, if it is a soft mouse
  2495.  */
  2496.  
  2497. #define  E_MouseOnName            "mouseOn"
  2498. #define  E_MouseOffName           "mouseOff"
  2499.  
  2500. /*
  2501.  * Show and move mouse to a given location
  2502.  */
  2503. #define  E_SetMouseName           "setMouse"
  2504.  
  2505. /*
  2506.  * Hide the mouse, even if it is a hardware cursor
  2507.  */
  2508. #define  E_HideMouseName          "hideMouse"
  2509.  
  2510. /*
  2511.  * Change the pointer image
  2512.  */
  2513. #define  E_DefineMouseName        "defineMouse"
  2514.  
  2515. /*
  2516.  * Perform changes on colormap
  2517.  */
  2518. #define  E_SetRGB8Name            "setRGB8"
  2519.  
  2520. /*
  2521.  * Defer task, until the end of the frame is reached
  2522.  */
  2523. #define  E_WaitTOFName            "waitTOF"
  2524.  
  2525. /*
  2526.  * Change a screens bitmap to a new bitmap, for double buffering
  2527.  */
  2528. #define  E_FlipMapName            "flipMap"
  2529.  
  2530. /*
  2531.  * Perform changes made to a screen spec, to be reflected on displayed
  2532.  * screens
  2533.  */
  2534. #define  E_RecalcViewName         "recalcView"
  2535.  
  2536. /*
  2537.  * Create a map2vide node
  2538.  */
  2539. #define  E_OpenMap2VideoName      "openMap2Video";
  2540.  
  2541. /*
  2542.  * Calculate the real display timings
  2543.  */
  2544. #define  E_GetRealTimingsName     "getRealTimings"
  2545.  
  2546.  
  2547. /*
  2548.  * Class names
  2549.  */
  2550. #define  E_DisplayDriverClassName "DisplayDriver.class"
  2551. #define  E_Map2VideoClassName     "Map2Video.class"
  2552. #define  E_BlankerClassname          "Blanker.class"
  2553.  
  2554.  
  2555.  
  2556. /*********************** EGS - Digitzer    ************************************/
  2557.  
  2558. struct E_Video2Map {
  2559.  
  2560.          struct         E_VideoDrain VideoDrain;
  2561.          E_EBitMapPtr   Map;
  2562. };
  2563.  
  2564. #define  E_Video2MapClassName  "Video2Map.class"
  2565.  
  2566. typedef struct E_Video2Map *E_Video2MapPtr;
  2567.  
  2568.  
  2569. /*********************** EGS - Monitors    ************************************/
  2570.  
  2571. /*  Directions      */
  2572.  
  2573. #define  E_LEFT         0
  2574. #define  E_UP           1
  2575. #define  E_RIGHT        2
  2576. #define  E_DOWN         3
  2577.  
  2578. typedef  struct E_Monitor *E_MonitorPtr;
  2579.  
  2580. struct E_Monitor {
  2581.  
  2582.         struct          E_VideoDrain VideoDrain;
  2583.         E_MonitorPtr    Border[4];
  2584. };
  2585.  
  2586.  
  2587. #define  E_MonitorClassName  "Monitor.class"
  2588.  
  2589. /*********************** EGS - Information ************************************/
  2590.  
  2591. /*
  2592.  * To realize the highest possible compatibility between different graphics
  2593.  * boards, the library must offer a function giving information about the
  2594.  * board(s) currently plugged in. Among these information items are the
  2595.  * resolutions that the board implements.
  2596.  * That task is carried out by the HardInfo structure and the procedure
  2597.  * "GetHardInfo". As serveral graphics devices are supported at the same time,
  2598.  * most of the fields are now void.
  2599.  * During accesses to the list you have to call E_LockEGSVideo..E_UnlockEGSVideo
  2600.  * to grant exclusive access.
  2601.  *
  2602.  */
  2603.  
  2604.  
  2605. typedef struct E_HardInfo *E_HardInfoPtr;
  2606.  
  2607. struct E_HardInfo {
  2608.          char             *Product, *Manufact, *Name; /* VOID */
  2609.          WORD              Version, MaxFreq;          /* VOID */
  2610.          ULONG             Flags;                     /* VOID */
  2611.          struct List      *Modes;                     /* avail screenmodes */
  2612.          WORD              ActPixClock, FrameTime;    /* VOID */
  2613.          APTR              MemBase;                   /* VOID */
  2614.          LONG              MemSize;                   /* VOID */
  2615.          char             *LibDate;
  2616.          struct List      *Drivers;                   /* avail displaydrivers */
  2617.             struct List      *Monitors;                  /* avail monitorspecs   */
  2618.             struct List         *VideoNodes;                      /* avail videonodes     */
  2619.             struct    List         *Screen;                          /* currently open screens */
  2620. };
  2621.  
  2622. #endif  /* EGS_EGS_H */
  2623.